﻿#include "wnd_set.h"


//#include "minigui_api.h"
#include <minigui/ctrl/static.h>
#include <minigui/ctrl/iconview.h>

#include <minigui/common.h>
#include <minigui/minigui.h>
#include <minigui/gdi.h>
#include <minigui/window.h>
#include <minigui/ctrl/button.h>
#include <minigui/ctrl/edit.h>
#include <minigui/ctrl/scrollview.h>
#include <minigui/ctrl/scrollbar.h>
#include <minigui/ctrl/menubutton.h>
#include <minigui/ctrl/button.h>



#include <mgi/mgi.h>
#include "redis_msg_handle.h"
#include "redis_ctrl.h"
#include "wnd_handle.h"
#include "wnd_dialog.h"
#include "wnd_api.h"

#if 0


/* 主菜单按钮消息*/
WND_API_ICON_MENU_S stGlbIconSetMenu[] = {
	{
		.s8MapPath = "share/res/png/set/基础设置-橙.png",
	},
	{
		.s8MapPath = "share/res/png/set/视频监控-橙.png",
	},
	{
		.s8MapPath = "share/res/png/set/数据采集-橙.png",
	},
	{
		.s8MapPath = "share/res/png/set/报警设置-橙.png",
	},
	{
		.s8MapPath = "share/res/png/set/设备维护-橙.png",
	},
	{
		.s8MapPath = "share/res/png/set/返回-橙.png",
	},

};

CTRLDATA stGlbBasicSetButton[] = {
	{
		.class_name = CTRL_BUTTON,
	    .dwStyle = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_NOTIFY,
	    .id = BASIC_MSG_REGISTER_E,
	    .caption= "注册消息",
	    .dwAddData = 0,
	    .dwExStyle = 0,
	    .werdr_name = "",
	},
	{
		.class_name = CTRL_BUTTON,
	    .dwStyle = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON| BS_NOTIFY,
	    .id = BASIC_MSG_TIME_E,
	    .caption= "时间设置",
	    .dwAddData = 0,
	    .dwExStyle = 0,
	    .werdr_name = "",
	},
	{
		.class_name = CTRL_BUTTON,
	    .dwStyle = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON| BS_NOTIFY,
	    .id = BASIC_MSG_DEV_ON_OFF_E,
	    .caption= "开关机设置",
	    .dwAddData = 0,
	    .dwExStyle = 0,
	    .werdr_name = "",
	},
	{
		.class_name = CTRL_BUTTON,
	    .dwStyle = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON| BS_NOTIFY,
	    .id = BASIC_MSG_USER_E,
	    .caption= "用户设置",
	    .dwAddData = 0,
	    .dwExStyle = 0,
	    .werdr_name = "",
	},
	{
		.class_name = CTRL_BUTTON,
	    .dwStyle = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON| BS_NOTIFY,
	    .id = BASIC_MSG_NET_E,
	    .caption= "网络设置",
	    .dwAddData = 0,
	    .dwExStyle = 0,
	    .werdr_name = "",
	},
	{
		.class_name = CTRL_BUTTON,
	    .dwStyle = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON| BS_NOTIFY,
	    .id = BASIC_MSG_NET_APP_E,
	    .caption= "网络应用",
	    .dwAddData = 0,
	    .dwExStyle = 0,
	    .werdr_name = "",
	},

};



/*开关机属性表里面的控件 */
static CTRLDATA stCtrlDevSwitchInfo [] =
{
	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SET_STAR_UP_INFO,
	    .caption= "开机方式",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_MENUBUTTON,
	    .dwStyle = WS_CHILD | WS_VISIBLE| MBS_ALIGNCENTER|MBS_NOBUTTON|WS_BORDER,
	    .id = IDC_SET_STAR_UP_MODE,
	    .caption= "",
	    .dwAddData = 0,
	},

	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SET_OFF_INFO,
	    .caption= "关机方式",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_MENUBUTTON,
	    .dwStyle = WS_CHILD | WS_VISIBLE | MBS_ALIGNCENTER|MBS_NOBUTTON|WS_BORDER,
	    .id = IDC_SET_OFF_MODE,
	    .caption= "",
	    .dwAddData = 0,
	},

	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_START_DELAY_INFO,
	    .caption= "点火开机延时",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_EDIT,
	    .dwStyle = WS_VISIBLE | WS_TABSTOP | WS_BORDER,
	    .id = IDC_START_DELAY_INPUT,
	    .caption= "",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_START_DELAY_INFO2,
	    .caption= "(0~60)秒",
	    .dwAddData = 0,
	},

	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SHUTDOWN_DELAY_INFO,
	    .caption= "点火关机延时",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_EDIT,
	    .dwStyle = WS_VISIBLE | WS_TABSTOP | WS_BORDER,
	    .id = IDC_SHUTDOWN_DELAY_INPUT,
	    .caption= "",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SHUTDOWN_DELAY_INFO2,
	    .caption= "(0~86399)秒",
	    .dwAddData = 0,
	},


	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_START_TIMING_INFO,
	    .caption= "定时开机时间",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_EDIT,
	    .dwStyle = WS_VISIBLE | WS_TABSTOP | WS_BORDER,
	    .id = IDC_START_TIMING_INPUT,
	    .caption= "",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_START_TIMING_INFO2,
	    .caption= "到",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_EDIT,
	    .dwStyle = WS_VISIBLE | WS_TABSTOP | WS_BORDER,
	    .id = IDC_START_TIMING_INPUT2,
	    .caption= "",
	    .dwAddData = 0,
	},

};

/*休眠属性表里面的控件 */
static CTRLDATA stCtrlSleepInfo[] =
{
	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SET_SLEEP_MODE_INFO,
	    .caption= "休眠模式",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_MENUBUTTON,
	    .dwStyle = WS_CHILD | WS_VISIBLE | MBS_ALIGNCENTER|MBS_NOBUTTON|WS_BORDER,
	    .id = IDC_SET_SLEEP_MODE_INPUT,
	    .caption= "",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SLEEP_LOW_INFO,
	    .caption= "低电压保护",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_BUTTON,
	    .dwStyle = WS_VISIBLE | BS_AUTOCHECKBOX,
	    .id = IDC_SLEEP_LOW_INPUT,
	    .caption= NULL,
	    .dwAddData = 0,
	},



	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SLEEP_BATT_LOW_INFO,
	    .caption= "蓄电池低电压保护",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_SLEDIT,
	    .dwStyle = WS_VISIBLE | WS_TABSTOP | WS_BORDER,
	    .id = IDC_SLEEP_BATT_LOW_INPUT,
	    .caption= "",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SLEEP_BATT_LOW_INFO2,
	    .caption= "(8~11.5)V",
	    .dwAddData = 0,
	},



	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SLEEP_REST_VOL_INFO,
	    .caption= "恢复开机电压值",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_SLEDIT,
	    .dwStyle = WS_VISIBLE | WS_TABSTOP | WS_BORDER,
	    .id = IDC_SLEEP_REST_VOL_INPUT,
	    .caption= "",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SLEEP_REST_VOL_INFO2,
	    .caption= "(12~14)V",
	    .dwAddData = 0,
	},




	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SLEEP_LOW_REP_INFO,
	    .caption= "低电压是否上报",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_BUTTON,
	    .dwStyle = WS_VISIBLE | BS_AUTOCHECKBOX,
	    .id = IDC_SLEEP_LOW_REP_INPUT,
	    .caption= NULL,
	    .dwAddData = 0,
	},



	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SLEEP_IGN_DELAY_INFO,
	    .caption= "点火休眠延时",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_SLEDIT,
	    .dwStyle = WS_VISIBLE | WS_TABSTOP | WS_BORDER,
	    .id = IDC_SLEEP_IGN_DELAY_INPUT,
	    .caption= "点火休眠延时",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SLEEP_IGN_DELAY_INFO2,
	    .caption= "(1~10)分钟",
	    .dwAddData = 0,
	},





	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SLEEP_OUTAGE_MODE_INFO,
	    .caption= "断电模式延时",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_SLEDIT,
	    .dwStyle = WS_VISIBLE | WS_TABSTOP | WS_BORDER,
	    .id = IDC_SLEEP_OUTAGE_MODE_INPUT,
	    .caption= "断电模式延时",
	    .dwAddData = 0,
	},
	{
		.class_name = CTRL_STATIC,
	    .dwStyle = WS_VISIBLE | SS_LEFT| WS_CHILD,
	    .id = IDC_SLEEP_OUTAGE_MODE_INFO2,
	    .caption= "(0~60)秒",
	    .dwAddData = 0,
	},

};


/* 开关机设置属性页 */
static DLGTEMPLATE stPageSysInfo[] ={

	{
		.dwStyle = WS_NONE,
		.dwExStyle = WS_EX_NONE,
		.x = 0,
		.y = 0,
		.w = 100,
		.h = 100,
		.caption = "开关机",
		.hIcon = 0,
		.hMenu = 0,
		.controlnr = sizeof(stCtrlDevSwitchInfo)/ sizeof(stCtrlDevSwitchInfo[0]),
		.controls = stCtrlDevSwitchInfo,
		.dwAddData = DEV_SWITCH_PAGE_ON_OFF,
	},
	{
	    .dwStyle = WS_NONE,
	    .dwExStyle = WS_EX_NONE,
	    //.x = 0,
	   // .y = 0,
	    //.w = 100,
	    //.h = 100,
	    .caption = "休眠",
	    .hIcon = 0,
	    .hMenu = 0,
	    .controlnr = sizeof(stCtrlSleepInfo)/ sizeof(stCtrlSleepInfo[0]),
	    .controls = stCtrlSleepInfo,
	    .dwAddData = DEV_SWITCH_PAGE_SLEEP,
	},
};


void MINI_SET_WND_MainMenuProc(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param);
static int MINI_SET_WND_ContainerProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
int MINI_SET_CreateSaveButton(WND_API_HANDLE_S * pstMainWnd);
int MINI_SET_WND_SaveParam(WND_API_HANDLE_S *pstMainWnd);
void MINI_SET_SaveButtonProc(unsigned int u32WndId, int message, int s32Param, unsigned long u64AddData);
int MINI_SET_WND_FlushDevSwitch(WND_API_HANDLE_S * pstMainWnd);
int MINI_SET_WND_SaveDevSwitchSParam(WND_API_HANDLE_S *pstMainWnd);


MINI_SET_WND_S stGlbSetWnd = {
	.stMainMenu = {
		.stIconHandle = {
			.pstIconMenu = stGlbIconSetMenu,
			.s32IconMenuNum = sizeof(stGlbIconSetMenu) / sizeof(stGlbIconSetMenu[0]),
			.s32Id = IDC_SET_BASIC_MENU,
			.u64Style = WS_BORDER | WS_CHILD | WS_THICKFRAME | WS_VISIBLE,
			.IconMenuProc = MINI_SET_WND_MainMenuProc,

		},
	},
	.stBaiscSet = {/* 基础设置菜单列表*/
		.stBasicSetListMenu = {
			.pstMenuList = stGlbBasicSetButton,
			.s32MenuListNum = sizeof(stGlbBasicSetButton)/sizeof(stGlbBasicSetButton[0]),
			.u32Style = WS_BORDER | WS_CHILD | WS_VISIBLE | WS_VSCROLL,
			.s32Id = IDC_SET_BASIC_LIST,
			.MenuListCallBack = MINI_SET_WND_ContainerProc,
		},
		.stPowerOnOff = {/* 开关机*/
			.pstPageInfo = stPageSysInfo,
			.s32PageNum = sizeof(stPageSysInfo) / sizeof(stPageSysInfo),
			.BasicSetDevSwitchFunc = MINI_SET_WND_SetPowerOnOff,
			.FlushDevSwitchDisplay  = MINI_SET_WND_FlushDevSwitch,
			.SaveDevSwitchSParam = MINI_SET_WND_SaveDevSwitchSParam,
		},
	},

	.stSaveButton = {
		.s8Name = "保存",
		.u64Style = WS_VISIBLE | BS_DEFPUSHBUTTON | WS_TABSTOP | WS_GROUP,
		.s32Id = IDC_SET_DEV_SWITCH_SAVE,
		.SaveButtonCreate = MINI_SET_CreateSaveButton,
		.SaveParam = MINI_SET_WND_SaveParam,
		.SaveProc = MINI_SET_SaveButtonProc
	},

};






void MINI_SET_WND_DestroyList(MINI_SET_WND_S *pstMenuWnd)
{

	if(pstMenuWnd->stCommonAttr.bWndCreatList) {
			DestroyWindow(pstMenuWnd->stCommonAttr.u32WndMenuList);
			pstMenuWnd->stCommonAttr.bWndCreatList = false;
	}
	if(pstMenuWnd->stCommonAttr.bWndCreatCent) {
		DestroyWindow(pstMenuWnd->stCommonAttr.u32WndCent);
		pstMenuWnd->stCommonAttr.bWndCreatCent = false;
	}

}


void MINI_SET_WND_DestroyListCent(MINI_SET_WND_S *pstMenuWnd)
{


	if(pstMenuWnd->stCommonAttr.bWndCreatCent) {
		DestroyWindow(pstMenuWnd->stCommonAttr.u32WndCent);
		pstMenuWnd->stCommonAttr.bWndCreatCent = false;
	}

}


#if 0
static void MINI_SET_WND_myDrawItem (HWND hWnd, HSVITEM hsvi, HDC hdc, RECT *rcDraw)
{
	const char *name = (const char*)scrollview_get_item_adddata (hsvi);
	//QLOG(TDBG, "1111\n");
	PLOGFONT pstFont = CreateLogFont("ttf", "simhei", "UTF-8",FONT_WEIGHT_REGULAR, FONT_SLANT_ROMAN,FONT_FLIP_NIL, FONT_OTHER_NIL,
							FONT_UNDERLINE_NONE, FONT_STRUCKOUT_NONE,32,0);

	SelectFont (hdc, pstFont);

	//SetBkMode (hdc, BM_OPAQUE);
	SetBkColor (hdc, PIXEL_black);
	SetTextColor (hdc, PIXEL_lightwhite);
	if (scrollview_is_item_hilight(hWnd, hsvi)) {
		SetBrushColor (hdc, PIXEL_blue);
		FillBox (hdc, rcDraw->left+1, rcDraw->top+1, RECTWP(rcDraw)-2, RECTHP(rcDraw)-1);
		SetBkColor (hdc, PIXEL_magenta);
		SetTextColor (hdc, PIXEL_lightwhite);
	}
	Rectangle (hdc, rcDraw->left, rcDraw->top, rcDraw->right - 1, rcDraw->bottom);
	TextOut (hdc, rcDraw->left + 3, rcDraw->top + 2, name);

	UpdateWindow(hWnd, TRUE);
	DestroyLogFont (pstFont);

}

#endif









/* 所有的属性页使用同一个窗口过程函数 */
static int MINI_SET_WND_PowerOnOffPageProc(HWND hDlg, int message, WPARAM wParam, LPARAM lParam)
{
	//QLOG(TDBG, "1111111111111111111111111111[0x%x] wParam[0x%x] lParam[0x%llx]\n", message, wParam, lParam);

	int id = 0;
	int code = 0;

	switch (message) {
	case MSG_INITPAGE:
		/* 获取属性页中静态框的句柄 */
		//get_systeminfo (hDlg);
		break;
	//case MSG_SHOWPAGE:
	//	return 1;
	case MSG_SHEETCMD:
		QLOG(TDBG, "属性表切换\n");
		if (wParam == IDOK)
			/* 用户单击对话框中的“刷新”按钮时，将调用该函数刷新 */
			//get_systeminfo(hDlg);


		return 0;

	case MSG_COMMAND: {

		id = LOWORD (wParam);
		code = HIWORD (wParam);
		QLOG(TDBG, "id[0x%x] code[0x%x]\n", id, code);
		switch(code) {
			case EN_KILLFOCUS:
				QLOG(TDBG, "隐藏 id[0x%x] code[0x%x]\n", id, code);
				ShowWindow(u32GlbSoftKeypadWnd, SW_HIDE);
				return 0;
			case EN_SETFOCUS:
				QLOG(TDBG, "显示id[0x%x] code[0x%x]\n", id, code);
				ShowWindow(u32GlbSoftKeypadWnd, SW_SHOWNORMAL);
				return 0;
		}
		break;
		}
	}
	return DefaultPageProc (hDlg, message, wParam, lParam);
}










int MINI_SET_WND_FlushDevSwitch(WND_API_HANDLE_S * pstMainWnd)
{
	ALL_PARAM_S stParam;
	PCAR_POWER_S *pstPower = &stParam.stCar.stPower;
	MINI_SET_WND_S *pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	char s8TempBuf[256];

	int s32Ret;
	s32Ret = REDIS_GetParam(pstGlbRedisProc->pstRedisHandle, P_CAR_POWER, &stParam, NULL);
	if(s32Ret < 0) {
		QLOG(ERR, "REDIS_GetParam faild\n");
		return -1;
	}


	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_SET_STAR_UP_MODE, MBM_SETCURITEM, pstPower->u32StartupMode, 0);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_SET_OFF_MODE, MBM_SETCURITEM, pstPower->u32StartupMode, 0);

	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32IgniteStartup);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_START_DELAY_INPUT, MSG_SETTEXT, (LPARAM)strlen(s8TempBuf), (LPARAM)s8TempBuf);

	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32IgniteDown);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_SHUTDOWN_DELAY_INPUT, MSG_SETTEXT, (LPARAM)strlen(s8TempBuf), (LPARAM)s8TempBuf);

	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32TimedShutdownStime);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_START_TIMING_INPUT, MSG_SETTEXT, (LPARAM)strlen(s8TempBuf), (LPARAM)s8TempBuf);

	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32TimedShutdownEtime);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_START_TIMING_INPUT2, MSG_SETTEXT, (LPARAM)strlen(s8TempBuf), (LPARAM)s8TempBuf);





	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SET_SLEEP_MODE_INPUT, MBM_SETCURITEM, pstPower->u32SleepMode, 0);



	if(pstPower->u32LowProtect == 1) {
		SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_LOW_INPUT, BM_SETCHECK, BST_CHECKED, 0);
	} else {
		SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_LOW_INPUT, BM_SETCHECK, BST_UNCHECKED, 0);
	}



	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	snprintf(s8TempBuf, sizeof(s8TempBuf), "%f", pstPower->s32BatteryLowProtect);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_BATT_LOW_INPUT, MSG_SETTEXT, (LPARAM)strlen(s8TempBuf), (LPARAM)s8TempBuf);

	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32RecoverySwitch);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_REST_VOL_INPUT, MSG_SETTEXT, (LPARAM)strlen(s8TempBuf), (LPARAM)s8TempBuf);

	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32IgniteSleepDelay);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_IGN_DELAY_INPUT, MSG_SETTEXT, (LPARAM)strlen(s8TempBuf), (LPARAM)s8TempBuf);

	if(pstPower->u32LowVoltageReporting == 1) {
		SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_LOW_REP_INPUT, BM_SETCHECK, BST_CHECKED, 0);
	} else {
		SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_LOW_REP_INPUT, BM_SETCHECK, BST_UNCHECKED, 0);
	}


	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32OutageDelay);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_OUTAGE_MODE_INPUT, MSG_SETTEXT, (LPARAM)strlen(s8TempBuf), (LPARAM)s8TempBuf);



	return 0;
}





int MINI_SET_WND_SetPowerOnOff(WND_API_HANDLE_S * pstMainWnd)
{

	MINI_SET_WND_S *pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	int s32WinX, y,w,h;

	s32WinX = pstMainWnd->stAttr.s32WndWidth/4;
	y = pstMainWnd->stAttr.s32WndHeight/6 + pstMainWnd->stAttr.s32WndHeight/12 + pstMainWnd->stAttr.s32WndHeight/75;
	w = pstMainWnd->stAttr.s32WndWidth - pstMainWnd->stAttr.s32WndWidth/4;
	h = pstMainWnd->stAttr.s32WndHeight-(pstMainWnd->stAttr.s32WndHeight/6 + pstMainWnd->stAttr.s32WndHeight/12) - pstMainWnd->stAttr.s32WndHeight/7;


	pstMenuWnd->stCommonAttr.u32WndCent =CreateWindow(CTRL_PROPSHEET,
									"",
									WS_BORDER | WS_CHILD | WS_VISIBLE| PSS_COMPACTTAB | PSS_SIMPLE | PSS_SCROLLABLE,
									IDC_SET_BASIC_DEV_SWITCH,
									s32WinX,
									y,
									w,
									h,
									pstMainWnd->stAttr.u32MainWnd, 0);








	pstMenuWnd->stCommonAttr.bWndCreatCent = true;
#if 1
	QLOG(TDBG, "创建属性表\n");
	/* 添加属性页，注意每个属性页具有不同的附加数据 */

	int s32Line = 6; 	/* 编辑 的选项有多少行，以此计算每行的间隔*/
	int s32LineNum = 1;	/* 行编号*/
	stCtrlDevSwitchInfo[0].x = w/5;
	stCtrlDevSwitchInfo[0].y = ((s32LineNum)*h)/s32Line - h/7; /* 流出7分之一安装确认按钮*/
	stCtrlDevSwitchInfo[0].w = (w*2)/10;
	stCtrlDevSwitchInfo[0].h = h/13;

	stCtrlDevSwitchInfo[1].x = (w*2)/5;
	stCtrlDevSwitchInfo[1].y = (s32LineNum*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[1].w = (w*3)/10;
	stCtrlDevSwitchInfo[1].h = h/13;

	s32LineNum = 2;
	stCtrlDevSwitchInfo[2].x = w/5;
	stCtrlDevSwitchInfo[2].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[2].w = (w*2)/10;
	stCtrlDevSwitchInfo[2].h = h/13;

	stCtrlDevSwitchInfo[3].x = (w*2)/5;
	stCtrlDevSwitchInfo[3].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[3].w = (w*3)/10;
	stCtrlDevSwitchInfo[3].h = h/13;


	s32LineNum = 3;
	stCtrlDevSwitchInfo[4].x = w/5;
	stCtrlDevSwitchInfo[4].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[4].w = (w*2)/10;
	stCtrlDevSwitchInfo[4].h = h/15;

	stCtrlDevSwitchInfo[5].x = (w*2)/5;
	stCtrlDevSwitchInfo[5].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[5].w = (w*2)/10;
	stCtrlDevSwitchInfo[5].h = h/15;

	stCtrlDevSwitchInfo[6].x = (w*3)/5 + w/20;
	stCtrlDevSwitchInfo[6].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[6].w = (w*2)/10;
	stCtrlDevSwitchInfo[6].h = h/15;


	s32LineNum = 4;
	stCtrlDevSwitchInfo[7].x = w/5;
	stCtrlDevSwitchInfo[7].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[7].w = (w*2)/10;
	stCtrlDevSwitchInfo[7].h = h/15;

	stCtrlDevSwitchInfo[8].x = (w*2)/5;
	stCtrlDevSwitchInfo[8].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[8].w = (w*2)/10;
	stCtrlDevSwitchInfo[8].h = h/15;

	stCtrlDevSwitchInfo[9].x = (w*3)/5 + w/20;
	stCtrlDevSwitchInfo[9].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[9].w = (w*2)/10;
	stCtrlDevSwitchInfo[9].h = h/15;


	s32LineNum = 5;
	stCtrlDevSwitchInfo[10].x = w/5;
	stCtrlDevSwitchInfo[10].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[10].w = (w*2)/10;
	stCtrlDevSwitchInfo[10].h = h/15;

	stCtrlDevSwitchInfo[11].x = (w*2)/5;
	stCtrlDevSwitchInfo[11].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[11].w = (w*2)/10;
	stCtrlDevSwitchInfo[11].h = h/15;

	stCtrlDevSwitchInfo[12].x = (w*3)/5;
	stCtrlDevSwitchInfo[12].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[12].w = (w*1)/20;
	stCtrlDevSwitchInfo[12].h = h/15;

	stCtrlDevSwitchInfo[13].x = (w*3)/5+(w*1)/20;
	stCtrlDevSwitchInfo[13].y = ((s32LineNum)*h)/s32Line - h/7;
	stCtrlDevSwitchInfo[13].w = (w*2)/10;
	stCtrlDevSwitchInfo[13].h = h/15;





	//stPageSysInfo[0].caption = "开关机";
	//stPageSysInfo[0].controlnr = sizeof(stCtrlDevSwitchInfo)/ sizeof(stCtrlDevSwitchInfo[0]);
	//stPageSysInfo.controls = stCtrlDevSwitchInfo;
	//stPageSysInfo.dwAddData = DEV_SWITCH_PAGE_ON_OFF;
	pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffIndex = SendMessage (pstMenuWnd->stCommonAttr.u32WndCent, PSM_ADDPAGE,
					(WPARAM)&pstMenuWnd->stBaiscSet.stPowerOnOff.pstPageInfo[0],//stPageSysInfo[0],
					(LPARAM)MINI_SET_WND_PowerOnOffPageProc);
	//QLOG(TDBG, "属性栏条目[%d]\n", s32DevSwitchId);

	pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg = SendMessage (pstMenuWnd->stCommonAttr.u32WndCent, PSM_GETPAGE, pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffIndex, 0);

	MENUBUTTONITEM mbi; 		// 声明一个菜单条目结构体变量
	mbi.text = "点火"; 			// 设置条目文字
	mbi.bmp = NULL; 			// 在这里可以指定位图对象
	mbi.data = 0;
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_SET_STAR_UP_MODE, MBM_ADDITEM, 0, (LPARAM)&mbi);

	mbi.text = "定时";
	mbi.data = 1;
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_SET_STAR_UP_MODE, MBM_ADDITEM, 0, (LPARAM)&mbi);
	mbi.text = "点火或定时";
	mbi.data = 2;
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_SET_STAR_UP_MODE, MBM_ADDITEM, 0, (LPARAM)&mbi);

	MENUBUTTONITEM stmbi;
	stmbi.bmp = NULL;

	stmbi.text = "点火不关机";
	stmbi.data = 0;
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_SET_OFF_MODE, MBM_ADDITEM, 0, (LPARAM)&stmbi);
	stmbi.bmp = NULL;

	stmbi.text = "点火关机";
	stmbi.data = 0;
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_SET_OFF_MODE, MBM_ADDITEM, 0, (LPARAM)&stmbi);







	/* 休眠模式按键分布调整 */
	s32Line = 8; 	/* 编辑 的选项有多少行，以此计算每行的间隔*/
	s32LineNum = 1;	/* 行编号*/
	stCtrlSleepInfo[0].x = w/5;
	stCtrlSleepInfo[0].y = ((s32LineNum)*h)/s32Line - h/10; /* 流出7分之一安装确认按钮*/
	stCtrlSleepInfo[0].w = (w*2)/10;
	stCtrlSleepInfo[0].h = h/13;

	stCtrlSleepInfo[1].x = (w*2)/5;
	stCtrlSleepInfo[1].y = (s32LineNum*h)/s32Line - h/10;
	stCtrlSleepInfo[1].w = (w*2)/10;
	stCtrlSleepInfo[1].h = h/13;

	s32LineNum = 2; /* 行编号*/
	stCtrlSleepInfo[2].x = w/5;
	stCtrlSleepInfo[2].y = ((s32LineNum)*h)/s32Line - h/10; /* 流出7分之一安装确认按钮*/
	stCtrlSleepInfo[2].w = (w*2)/10;
	stCtrlSleepInfo[2].h = h/13;

	stCtrlSleepInfo[3].x = (w*2)/5;
	stCtrlSleepInfo[3].y = (s32LineNum*h)/s32Line - h/10;
	stCtrlSleepInfo[3].w = (w*2)/60;
	stCtrlSleepInfo[3].h = h/30;



	s32LineNum = 3; /* 行编号*/
	stCtrlSleepInfo[4].x = w/5;
	stCtrlSleepInfo[4].y = ((s32LineNum)*h)/s32Line - h/10; /* 流出7分之一安装确认按钮*/
	stCtrlSleepInfo[4].w = (w*2)/10;
	stCtrlSleepInfo[4].h = h/14;

	stCtrlSleepInfo[5].x = (w*2)/5;
	stCtrlSleepInfo[5].y = (s32LineNum*h)/s32Line - h/10;
	stCtrlSleepInfo[5].w = (w*2)/10;
	stCtrlSleepInfo[5].h = h/14;

	stCtrlSleepInfo[6].x = (w*3)/5;
	stCtrlSleepInfo[6].y = (s32LineNum*h)/s32Line - h/10;
	stCtrlSleepInfo[6].w = (w*2)/10;
	stCtrlSleepInfo[6].h = h/14;




	s32LineNum = 4; /* 行编号*/
	stCtrlSleepInfo[7].x = w/5;
	stCtrlSleepInfo[7].y = ((s32LineNum)*h)/s32Line - h/10; /* 流出7分之一安装确认按钮*/
	stCtrlSleepInfo[7].w = (w*2)/10;
	stCtrlSleepInfo[7].h = h/14;

	stCtrlSleepInfo[8].x = (w*2)/5;
	stCtrlSleepInfo[8].y = (s32LineNum*h)/s32Line - h/10;
	stCtrlSleepInfo[8].w = (w*2)/10;
	stCtrlSleepInfo[8].h = h/14;

	stCtrlSleepInfo[9].x = (w*3)/5;
	stCtrlSleepInfo[9].y = (s32LineNum*h)/s32Line - h/10;
	stCtrlSleepInfo[9].w = (w*2)/10;
	stCtrlSleepInfo[9].h = h/14;

	s32LineNum = 5; /* 行编号*/
	stCtrlSleepInfo[10].x = w/5;
	stCtrlSleepInfo[10].y = ((s32LineNum)*h)/s32Line - h/10; /* 流出7分之一安装确认按钮*/
	stCtrlSleepInfo[10].w = (w*2)/10;
	stCtrlSleepInfo[10].h = h/14;

	stCtrlSleepInfo[11].x = (w*2)/5;
	stCtrlSleepInfo[11].y = (s32LineNum*h)/s32Line - h/10;
	stCtrlSleepInfo[11].w = (w*2)/60;
	stCtrlSleepInfo[11].h = h/30;




	s32LineNum = 6; /* 行编号*/
	stCtrlSleepInfo[12].x = w/5;
	stCtrlSleepInfo[12].y = ((s32LineNum)*h)/s32Line - h/10; /* 流出7分之一安装确认按钮*/
	stCtrlSleepInfo[12].w = (w*2)/10;
	stCtrlSleepInfo[12].h = h/14;

	stCtrlSleepInfo[13].x = (w*2)/5;
	stCtrlSleepInfo[13].y = (s32LineNum*h)/s32Line - h/10;
	stCtrlSleepInfo[13].w = (w*2)/10;
	stCtrlSleepInfo[13].h = h/14;

	stCtrlSleepInfo[14].x = (w*3)/5;
	stCtrlSleepInfo[14].y = (s32LineNum*h)/s32Line - h/10;
	stCtrlSleepInfo[14].w = (w*2)/10;
	stCtrlSleepInfo[14].h = h/14;


	s32LineNum = 7; /* 行编号*/
	stCtrlSleepInfo[15].x = w/5;
	stCtrlSleepInfo[15].y = ((s32LineNum)*h)/s32Line - h/10; /* 流出7分之一安装确认按钮*/
	stCtrlSleepInfo[15].w = (w*2)/10;
	stCtrlSleepInfo[15].h = h/14;

	stCtrlSleepInfo[16].x = (w*2)/5;
	stCtrlSleepInfo[16].y = (s32LineNum*h)/s32Line - h/10;
	stCtrlSleepInfo[16].w = (w*2)/10;
	stCtrlSleepInfo[16].h = h/14;

	stCtrlSleepInfo[17].x = (w*3)/5;
	stCtrlSleepInfo[17].y = (s32LineNum*h)/s32Line - h/10;
	stCtrlSleepInfo[17].w = (w*2)/10;
	stCtrlSleepInfo[17].h = h/14;


	//stPageSysInfo.caption = "休眠";
	//stPageSysInfo.controlnr = sizeof(stCtrlSleepInfo)/ sizeof(stCtrlSleepInfo[0]);
	//stPageSysInfo.controls = stCtrlSleepInfo;
	//stPageSysInfo.dwAddData = DEV_SWITCH_PAGE_SLEEP;
	pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepIndex = SendMessage(pstMenuWnd->stCommonAttr.u32WndCent, PSM_ADDPAGE,
				(WPARAM)&pstMenuWnd->stBaiscSet.stPowerOnOff.pstPageInfo[1],
				//stPageSysInfo[1],
				(LPARAM)MINI_SET_WND_PowerOnOffPageProc);

	pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg = SendMessage (pstMenuWnd->stCommonAttr.u32WndCent, PSM_GETPAGE, pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepIndex, 0);
	//QLOG(TDBG, "属性栏条目2[%d]\n", s32SleepId);

	MENUBUTTONITEM stSleepMbi;
	stSleepMbi.bmp = NULL;

	stSleepMbi.text = "不休眠";
	stSleepMbi.data = 0;
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SET_SLEEP_MODE_INPUT, MBM_ADDITEM, 0, (LPARAM)&stSleepMbi);

	stSleepMbi.text = "点火休眠";
	stSleepMbi.data = 0;
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SET_SLEEP_MODE_INPUT, MBM_ADDITEM, 0, (LPARAM)&stSleepMbi);

	stSleepMbi.text = "断电模式";
	stSleepMbi.data = 0;
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SET_SLEEP_MODE_INPUT, MBM_ADDITEM, 0, (LPARAM)&stSleepMbi);


	/* 设置显示开关机页面*/
	SendMessage(pstMenuWnd->stCommonAttr.u32WndCent, PSM_SETACTIVEINDEX, pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffIndex, 0);


	//MINI_SET_WND_FlushDevSwitch(pstMainWnd);
	if(pstMenuWnd->stBaiscSet.stPowerOnOff.FlushDevSwitchDisplay) {
		pstMenuWnd->stBaiscSet.stPowerOnOff.FlushDevSwitchDisplay(pstMainWnd);
	} else {
		QLOG(WRN, "开关机显示刷新函数未注册\n");
	}


	//mgiCreateSoftKeypad(notify_ime_status2);
#endif
	return 0;

}

static int MINI_SET_WND_ContainerProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{
	WND_API_HANDLE_S * pstMainWnd = WND_API_GetMainWnd(WND_TYPE_SET_E);
	MINI_SET_WND_S *pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	//QLOG(TDBG, "message[0x%x]\n", message);

	switch (message) {

		case MSG_COMMAND:
		{
			int id = LOWORD (wParam);
			int code = HIWORD (wParam);

			QLOG(TDBG, "开关机界面发生变化\n");

			if (code == BN_CLICKED) {
				switch (id) {

					case BASIC_MSG_REGISTER_E:	{	/* 注册消息*/
						pstMenuWnd->stBaiscSet.enBasicSetSta = BASIC_MSG_REGISTER_E;
						MINI_SET_WND_DestroyListCent(pstMenuWnd);
						QLOG(TDBG, "注册消息\n");
					}
					break;
					case BASIC_MSG_TIME_E:{			/* 时间设置*/
						QLOG(TDBG, "时间设置\n");
						pstMenuWnd->stBaiscSet.enBasicSetSta = BASIC_MSG_TIME_E;
						MINI_SET_WND_DestroyListCent(pstMenuWnd);
					}
					break;
					case BASIC_MSG_DEV_ON_OFF_E:{		/* 开关机设置*/
						QLOG(TDBG, "开关机设置\n");
						pstMenuWnd->stBaiscSet.enBasicSetSta = BASIC_MSG_DEV_ON_OFF_E;

						MINI_SET_WND_DestroyListCent(pstMenuWnd);
						if(pstMenuWnd->stBaiscSet.stPowerOnOff.BasicSetDevSwitchFunc) {
							pstMenuWnd->stBaiscSet.stPowerOnOff.BasicSetDevSwitchFunc(pstMainWnd);
						}
					}
					break;
					case BASIC_MSG_USER_E:	{		/* 用户设置*/
						QLOG(TDBG, "用户设置\n");
						pstMenuWnd->stBaiscSet.enBasicSetSta = BASIC_MSG_USER_E;
						MINI_SET_WND_DestroyListCent(pstMenuWnd);
					}
					break;
					case BASIC_MSG_NET_E:{				/* 网络设置*/
						QLOG(TDBG, "网络设置\n");
						pstMenuWnd->stBaiscSet.enBasicSetSta = BASIC_MSG_NET_E;
						MINI_SET_WND_DestroyListCent(pstMenuWnd);
					}
					break;
					case BASIC_MSG_NET_APP_E:{			/* 网络应用设置*/
						QLOG(TDBG, "网络应用设置\n");
						pstMenuWnd->stBaiscSet.enBasicSetSta = BASIC_MSG_NET_APP_E;
						MINI_SET_WND_DestroyListCent(pstMenuWnd);
					}
					break;

				}
				break;
			}
		}
		break;
		case PSN_ACTIVE_CHANGED:{

			//QLOG(TDBG, "开关机界面发生变化\n");
			break;
		}
		case EN_SETFOCUS:{
			QLOG(TDBG, "输入界面有变化\n");
			break;
		}


		case MSG_PAINT:
		{
			//QLOG(TDBG, "22222\n");
			HDC hdc = BeginPaint (hWnd);

			EndPaint (hWnd, hdc);


			return 0;
		}
	}
	return DefaultContainerProc(hWnd, message, wParam, lParam);
}






int MINI_SET_WND_CreateBisaSetMenu(WND_API_HANDLE_S *pstMainWnd)
{
	MINI_SET_WND_S *pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	int s32WinX, y,w,h, s32ButtonHight;


	s32WinX = 0;
	y = pstMainWnd->stAttr.s32WndHeight/6 + pstMainWnd->stAttr.s32WndHeight/12;
	w = pstMainWnd->stAttr.s32WndWidth/4;
	h = pstMainWnd->stAttr.s32WndHeight-(pstMainWnd->stAttr.s32WndHeight/6 + pstMainWnd->stAttr.s32WndHeight/12);
	s32ButtonHight = h/3;


	//PLOGFONT pstFont = CreateLogFont("ttf", "simhei", "UTF-8",FONT_WEIGHT_REGULAR, FONT_SLANT_ROMAN,FONT_FLIP_NIL, FONT_OTHER_NIL,
	//							FONT_UNDERLINE_NONE, FONT_STRUCKOUT_NONE, 24, 0);

	//WND_API_LIST_MENU_HNADLE_S stListMenu;

	//pstMenuWnd->stBasicSetListMenu.pstMenuList = stGlbBasicSetButton;
	//pstMenuWnd->stBasicSetListMenu.s32MenuListNum = sizeof(stGlbBasicSetButton)/sizeof(stGlbBasicSetButton[0]);
	//pstMenuWnd->stBasicSetListMenu.u32Style = WS_BORDER | WS_CHILD | WS_VISIBLE | WS_VSCROLL;
	//pstMenuWnd->stBasicSetListMenu.s32Id = IDC_SET_BASIC_LIST;
	pstMenuWnd->stBaiscSet.stBasicSetListMenu.s32WinX = s32WinX;
	pstMenuWnd->stBaiscSet.stBasicSetListMenu.s32WndY = y;
	pstMenuWnd->stBaiscSet.stBasicSetListMenu.s32WndWidth = w;
	pstMenuWnd->stBaiscSet.stBasicSetListMenu.s32WndHeight = h;
	pstMenuWnd->stBaiscSet.stBasicSetListMenu.u32ParentWnd = pstMainWnd->stAttr.u32MainWnd;
	pstMenuWnd->stBaiscSet.stBasicSetListMenu.s32ButtonHight = h/4;
	//pstMenuWnd->stBaiscSet.stBasicSetListMenu.MenuListCallBack = MINI_SET_WND_ContainerProc;
	pstMenuWnd->stBaiscSet.stBasicSetListMenu.s32NewBkColor = COLOR_yellow;
	pstMenuWnd->stBaiscSet.stBasicSetListMenu.pstFont = CreateLogFont("ttf", "simhei", "UTF-8",FONT_WEIGHT_REGULAR, FONT_SLANT_ROMAN,FONT_FLIP_NIL, FONT_OTHER_NIL,
								FONT_UNDERLINE_NONE, FONT_STRUCKOUT_NONE, 24, 0);

	pstMenuWnd->stCommonAttr.u32WndMenuList = WND_API_CreateListMenu(&pstMenuWnd->stBaiscSet.stBasicSetListMenu);

	return 0;
}






int MINI_SET_WND_Switch(HWND hWnd, int s32Switch)
{
	WND_API_HANDLE_S * pstMainWnd = NULL;
	pstMainWnd = WND_API_GetMainWnd(WND_TYPE_SET_E);
	MINI_SET_WND_S *pstMenuWnd = NULL;
	pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	switch(s32Switch) {
		/* 基础设置*/
		case 0: {

			MINI_SET_WND_DestroyList(pstMenuWnd);

			MINI_SET_WND_CreateBisaSetMenu(pstMainWnd);
			pstMenuWnd->stCommonAttr.enType = DEV_SET_BASIC_SET_E;
			pstMenuWnd->stCommonAttr.bWndCreatList = true;
			break;
		}
		/* 视频监控*/
		case 1: {
			MINI_SET_WND_DestroyList(pstMenuWnd);
			pstMenuWnd->stCommonAttr.bWndCreatList = true;

			pstMenuWnd->stCommonAttr.enType = DEV_SET_VIDEO_E;
			break;
		}
		/* 数据采集*/
		case 2: {
			MINI_SET_WND_DestroyList(pstMenuWnd);
			pstMenuWnd->stCommonAttr.enType = DEV_SET_DATE_E;
			pstMenuWnd->stCommonAttr.bWndCreatList = true;

			break;
		}
		/* 报警设置*/
		case 3: {
			MINI_SET_WND_DestroyList(pstMenuWnd);
			pstMenuWnd->stCommonAttr.bWndCreatList = true;
			pstMenuWnd->stCommonAttr.enType = DEV_SET_ALARM_E;
			break;
		}
		/* 设备维护*/
		case 4: {
			MINI_SET_WND_DestroyList(pstMenuWnd);
			pstMenuWnd->stCommonAttr.enType = DEV_SE_DEV_QUE_E;
			pstMenuWnd->stCommonAttr.bWndCreatList = true;

			break;
		}
		/* 退出*/
		case 5: {
			//MINI_SET_WND_DestroyList(pstMenuWnd);
			//DestroyWindow(pstMenuWnd->u32WndMenuMain);
			//DestroyMainWindow(hWnd);
			//pstMenuWnd->enType = DEV_SETT_QUIT_E;
			WND_API_DestroyMainWnd(WND_TYPE_DEV_MNG_E, WND_TYPE_SET_E);
			pstMenuWnd->stCommonAttr.enType = DEV_SETT_QUIT_E;

			break;
		}

	}
	return 0;
}

/* 保存开关机*/
int MINI_SET_WND_SaveDevSwitchSParam(WND_API_HANDLE_S *pstMainWnd)
{
	ALL_PARAM_S stParam;
	PCAR_POWER_S *pstPower = &stParam.stCar.stPower;
	MINI_SET_WND_S *pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	char s8TempBuf[256];

	int s32Ret;
	s32Ret = REDIS_GetParam(pstGlbRedisProc->pstRedisHandle, P_CAR_POWER, &stParam, NULL);
	if(s32Ret < 0) {
		QLOG(ERR, "REDIS_GetParam faild\n");
		return -1;
	}


	pstPower->u32StartupMode = SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_SET_STAR_UP_MODE, MBM_GETCURITEM, 0, 0);
	if(pstPower->u32StartupMode < 0) {
		QLOG(ERR, "IDC_SET_STAR_UP_MODE MBM_GETCURITEM faild[%d]\n", pstPower->u32StartupMode);
		return -1;
	}
	pstPower->u32StartupMode = SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_SET_OFF_MODE, MBM_GETCURITEM, pstPower->u32StartupMode, 0);
	if(pstPower->u32StartupMode < 0) {
		QLOG(ERR, "IDC_SET_OFF_MODE MBM_GETCURITEM faild[%d]\n", pstPower->u32StartupMode);
		return -1;
	}



	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_START_DELAY_INPUT, MSG_GETTEXT, (LPARAM)sizeof(s8TempBuf), (LPARAM)s8TempBuf);
	sscanf(s8TempBuf, "%u", &pstPower->u32IgniteStartup);
	//QLOG(TDBG, "%u\n", pstPower->u32IgniteStartup);



	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_SHUTDOWN_DELAY_INPUT, MSG_GETTEXT, (LPARAM)sizeof(s8TempBuf), (LPARAM)s8TempBuf);
	sscanf(s8TempBuf, "%u", &pstPower->u32IgniteDown);

	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	//snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32TimedShutdownStime);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_START_TIMING_INPUT, MSG_GETTEXT, (LPARAM)sizeof(s8TempBuf), (LPARAM)s8TempBuf);
	sscanf(s8TempBuf, "%u", &pstPower->u32TimedShutdownStime);

	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	//snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32TimedShutdownEtime);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevOnOffDlg, IDC_START_TIMING_INPUT2, MSG_GETTEXT, (LPARAM)sizeof(s8TempBuf), (LPARAM)s8TempBuf);
	sscanf(s8TempBuf, "%u", &pstPower->u32TimedShutdownEtime);





	pstPower->u32SleepMode = SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SET_SLEEP_MODE_INPUT, MBM_GETCURITEM, 0, 0);
	if(pstPower->u32SleepMode < 0) {
		QLOG(ERR, "IDC_SET_OFF_MODE MBM_GETCURITEM faild[%d]\n", pstPower->u32SleepMode);
		return -1;
	}



	s32Ret = SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_LOW_INPUT, BM_GETCHECK, 0, 0);
	if(s32Ret == BST_CHECKED) {
		pstPower->u32LowProtect = 1;
	} else if(s32Ret == BST_UNCHECKED){
		pstPower->u32LowProtect = 0;
	}
	//SLOG(TDBG, "%d\n", pstPower->u32LowProtect);

	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	//snprintf(s8TempBuf, sizeof(s8TempBuf), "%f", pstPower->s32BatteryLowProtect);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_BATT_LOW_INPUT, MSG_GETTEXT, (LPARAM)sizeof(s8TempBuf), (LPARAM)s8TempBuf);
	sscanf(s8TempBuf, "%f", &pstPower->s32BatteryLowProtect);

	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	//snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32RecoverySwitch);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_REST_VOL_INPUT, MSG_GETTEXT, (LPARAM)sizeof(s8TempBuf), (LPARAM)s8TempBuf);
	sscanf(s8TempBuf, "%u", &pstPower->u32RecoverySwitch);

	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	//snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32IgniteSleepDelay);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_IGN_DELAY_INPUT, MSG_GETTEXT, (LPARAM)sizeof(s8TempBuf), (LPARAM)s8TempBuf);
	sscanf(s8TempBuf, "%u", &pstPower->u32IgniteSleepDelay);

	s32Ret = SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_LOW_REP_INPUT, BM_GETCHECK, 0, 0);
	if(s32Ret == BST_CHECKED) {
		pstPower->u32LowVoltageReporting = 1;
	} else if(s32Ret == BST_UNCHECKED){
		pstPower->u32LowVoltageReporting = 0;
	}


	memset(&s8TempBuf, 0, sizeof(s8TempBuf));
	//snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32OutageDelay);
	SendDlgItemMessage(pstMenuWnd->stBaiscSet.stPowerOnOff.s32DevSleepDlg, IDC_SLEEP_OUTAGE_MODE_INPUT, MSG_GETTEXT, (LPARAM)sizeof(s8TempBuf), (LPARAM)s8TempBuf);
	sscanf(s8TempBuf, "%u", &pstPower->u32OutageDelay);

#if 0

#endif

	REDIS_MSG_RES_S stMsgRes;


	s32Ret = REDIS_SetSendAndWait(pstGlbRedisProc->pstRedisHandle, P_CAR_POWER, &stParam, RMSG_SYS_POWER, &stMsgRes, 5);
	if(s32Ret < 0 || stMsgRes.s32Res < 0) {
		QLOG(ERR, "REDIS_SetSendAndWait faild s32Ret[%d] s32Res[%d]\n", s32Ret, stMsgRes.s32Res);
		return -1;
	}


	return 0;
}


/* 保存基础设置参数参数*/
int MINI_SET_WND_SaveBasicSetParam(WND_API_HANDLE_S *pstMainWnd)
{
	MINI_SET_WND_S * pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;

	switch (pstMenuWnd->stBaiscSet.enBasicSetSta) {

		case BASIC_MSG_REGISTER_E:	{	/* 注册消息*/

		}
		break;
		case BASIC_MSG_TIME_E:{			/* 时间设置*/
			QLOG(TDBG, "时间设置参数保存\n");

		}
		break;
		case BASIC_MSG_DEV_ON_OFF_E:{		/* 开关机设置*/
			QLOG(TDBG, "开关机设置参数保存\n");
			//MINI_SET_WND_SaveDevSwitchSParam(pstMainWnd);
			if(pstMenuWnd->stBaiscSet.stPowerOnOff.SaveDevSwitchSParam) {
				pstMenuWnd->stBaiscSet.stPowerOnOff.SaveDevSwitchSParam(pstMainWnd);
			} else {
				QLOG(ERR, "开关机未注册保存函数\n");
			}
		}
		break;
		case BASIC_MSG_USER_E:	{		/* 用户设置*/
			QLOG(TDBG, "用户设置参数保存\n");

		}
		break;
		case BASIC_MSG_NET_E:{				/* 网络设置*/
			QLOG(TDBG, "网络设置参数保存\n");

		}
		break;
		case BASIC_MSG_NET_APP_E:{			/* 网络应用设置*/
			QLOG(TDBG, "网络应用设置参数保存\n");

		}
		break;

	}
	return 0;
}

/* 保存参数*/
int MINI_SET_WND_SaveParam(WND_API_HANDLE_S *pstMainWnd)
{
	MINI_SET_WND_S *pstMenuWnd = NULL;

	if(NULL == pstMainWnd) {
		QLOG(ERR, "未找到主界面\n");
		return -1;
	}

	pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	if(NULL == pstMenuWnd) {
		QLOG(ERR, "未找到主界面私有属性\n");
		return -1;
	}

	switch(pstMenuWnd->stCommonAttr.enType) {
		case 	DEV_SET_BASIC_SET_E:	{	/* 基础设置*/
			MINI_SET_WND_SaveBasicSetParam(pstMainWnd);
		}
		break;
		case 	DEV_SET_VIDEO_E:{				/* 视频监控*/

		}
		break;
		case 	DEV_SET_DATE_E:{					/* 数据采集*/

		}
		break;
		case 	DEV_SET_ALARM_E:{				/* 报警设置*/

		}
		break;
		case 	DEV_SE_DEV_QUE_E:{				/* 设备维护*/

		}
		break;
		case 	DEV_SETT_QUIT_E:{				/* 退出*/

		}
		break;
	}
	return 0;
}





void MINI_SET_WND_MainMenuProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{

	WND_API_HANDLE_S * pstMainWnd = NULL;
	//pstMainWnd = WND_API_GetMainWnd(WND_TYPE_SET_E);
	pstMainWnd = (WND_API_HANDLE_S *)GetWindowAdditionalData(hWnd);
	MINI_SET_WND_S *pstMenuWnd = NULL;

	if(NULL == pstMainWnd) {
		QLOG(ERR, "未找到主界面\n");
		return -1;
	}

	pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	if(NULL == pstMenuWnd) {
		QLOG(ERR, "未找到主界面私有属性\n");
		return -1;
	}
	QLOG(TDBG, "message[0x%x] wParam[0x%x] lParam[0x%llx] \n", message, wParam, lParam);

	switch (message) {
		case IDC_SET_BASIC_MENU:
		{
			int id = LOWORD (wParam);
			int code = HIWORD (wParam);
			int sel;
			QLOG(TDBG, "列表窗口被点击 id[0x%x] code[0x%x]\n", id, code);

			/* 主按钮被点击*/

			if (id == IVN_SELCHANGED) {

				sel = SendMessage (pstMenuWnd->stMainMenu.u32WndMenuMain, IVM_GETCURSEL, 0, 0);
				QLOG(TDBG, "clicking %d wParam[0x%x]\n", sel, wParam);
				MINI_SET_WND_Switch(hWnd, sel);
			}
			break;

		}
	}
}

int MINI_SET_WND_CreateMainMenu(WND_API_HANDLE_S *pstMainWnd, HWND hWnd)
{

	if(NULL == pstMainWnd) {
		QLOG(ERR, "窗口结构体为空\n");
		return -1;
	}

	MINI_SET_WND_S *pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	//WND_API_ICON_MENU_HNADLE_S stIconHandle;

	//pstMenuWnd->stIconHandle.pstIconMenu = stGlbIconSetMenu;
	//pstMenuWnd->stIconHandle.s32IconMenuNum = sizeof(stGlbIconSetMenu) / sizeof(stGlbIconSetMenu[0]);
	pstMenuWnd->stMainMenu.stIconHandle.u32ParentWnd = hWnd;
	//pstMenuWnd->stIconHandle.s32Id = IDC_SET_BASIC_MENU;
	//pstMenuWnd->stIconHandle.u64Style = WS_BORDER | WS_CHILD | WS_THICKFRAME | WS_VISIBLE;
	pstMenuWnd->stMainMenu.stIconHandle.s32NewBkcolor = COLOR_black;
	pstMenuWnd->stMainMenu.stIconHandle.s32WndX = pstMainWnd->stAttr.s32WndWidth/200;
	pstMenuWnd->stMainMenu.stIconHandle.s32WndY = 0;
	pstMenuWnd->stMainMenu.stIconHandle.s32WndWidth = pstMainWnd->stAttr.s32WndWidth;
	pstMenuWnd->stMainMenu.stIconHandle.s32WndHeight = pstMainWnd->stAttr.s32WndHeight/6 + pstMainWnd->stAttr.s32WndHeight/12;
	pstMenuWnd->stMainMenu.stIconHandle.s23IconWidth = pstMainWnd->stAttr.s32WndWidth/7+pstMainWnd->stAttr.s32WndWidth*2/132;
	pstMenuWnd->stMainMenu.stIconHandle.s32IconHeight = pstMainWnd->stAttr.s32WndHeight/5;
	pstMenuWnd->stMainMenu.stIconHandle.u64AddData = pstMainWnd;

	//pstMenuWnd->stIconHandle.IconMenuProc = MINI_SET_WND_MainMenuProc;

	pstMenuWnd->stMainMenu.u32WndMenuMain = WND_API_CreateMainWndMenuByIcon(&pstMenuWnd->stMainMenu.stIconHandle);




	return 0;
}


int MINI_SET_CreateSaveButton(WND_API_HANDLE_S * pstMainWnd)
{
	MINI_SET_WND_S *pstMenuWnd = NULL;
	pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	if(NULL == pstMenuWnd) {
		QLOG(ERR, "未找到主界面私有属性\n");
		return -1;
	}

	pstMenuWnd->stSaveButton.u32WndDevSwitchSave = CreateWindow(CTRL_BUTTON,
														"保存",//CTRL_COMBOBOX
														WS_VISIBLE | BS_DEFPUSHBUTTON | WS_TABSTOP | WS_GROUP,
														//WS_CHILD | WS_VISIBLE|WS_BORDER,
														IDC_SET_DEV_SWITCH_SAVE,
														600,//(s32WinX*4)/6,
														500,//(y*4)/6,
														60,//(w*4)/6,
														60,//(h*4)/6,
														pstMainWnd->stAttr.u32MainWnd, //pstMainWnd->u32MainWnd,
														pstMainWnd);
	return 0;
}

void MINI_SET_SaveButtonProc(unsigned int u32WndId, int message, int s32Param, unsigned long u64AddData)
{
	WND_API_HANDLE_S * pstMainWnd = NULL;
	//pstMainWnd = WND_API_GetMainWnd(WND_TYPE_SET_E);
	pstMainWnd = (WND_API_HANDLE_S *)GetWindowAdditionalData(u32WndId);
	MINI_SET_WND_S *pstMenuWnd = NULL;

	if(NULL == pstMainWnd) {
		QLOG(ERR, "未找到主界面\n");
		return ;
	}

	pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	if(NULL == pstMenuWnd) {
		QLOG(ERR, "未找到主界面私有属性\n");
		return ;
	}
	switch (message) {
		case IDC_SET_DEV_SWITCH_SAVE: {
			MINI_SET_WND_SaveParam(pstMainWnd);
		}
		break;
	}

}

int PagTesteProc(HWND u32Dlg, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	return DefaultPageProc (u32Dlg, s32Message, u32Param, u64Param);

}

#if 0

static int MINI_SET_WND_WindowTestProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{
    HDC hdc;



	//QLOG(TDBG, "列表窗口被点击 message[0x%x]\n", message);


    switch (message) {


		case MSG_CREATE:


		break;
        case MSG_PAINT:
			QLOG(TDBG, "创建滑块\n");
           	hdc = MINI_API_BeginPaint(hWnd);
			//SetBrushColor (hdc, RGB2Pixel(hdc, 0xff, 0, 0));

			//FillBox (hdc, 0, 0, 250, 10);

            MINI_API_EndPaint (hWnd, hdc);
        	break;
        case MSG_CLOSE:
			QLOG(TDBG, "结束滑块\n");
			//DestroyLogFont(pstFont);
            DestroyWindow (hWnd);
            break;
    }

    return DefaultControlProc(hWnd, message, wParam, lParam);
}
#endif
//HWND u32SoftKeypadWnd;
//static GHANDLE ime_handle;

static int MINI_SET_WND_WindowProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{
    HDC hdc;

	WND_API_HANDLE_S * pstMainWnd = NULL;
	//pstMainWnd = WND_API_GetMainWnd(WND_TYPE_SET_E);
	pstMainWnd = (WND_API_HANDLE_S *)GetWindowAdditionalData(hWnd);
	MINI_SET_WND_S *pstMenuWnd = NULL;


	if(NULL == pstMainWnd) {
		QLOG(ERR, "未找到主界面\n");
		return -1;
	}

	pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	if(NULL == pstMenuWnd) {
		QLOG(ERR, "未找到主界面私有属性\n");
		return -1;
	}




    switch (message) {

		case MSG_CREATE:


			pstMainWnd->stAttr.u32MainWnd = hWnd;
			POINT pt;
			IME_TARGET_INFO info;
			pt.x = 150;
			pt.y = 150;
			SetIMEPos(&pt);
			GetIMETargetInfo (&info);
			printf("x[%d] y[%d]\n", info.ptCaret.x, info.ptCaret.y);

			/* 创建图标控件*/
			MINI_SET_WND_CreateMainMenu(pstMainWnd, hWnd);
			if(pstMenuWnd->stSaveButton.SaveButtonCreate) {
				pstMenuWnd->stSaveButton.u32WndDevSwitchSave = pstMenuWnd->stSaveButton.SaveButtonCreate(pstMainWnd);
				if(pstMenuWnd->stSaveButton.SaveProc) {
					SetNotificationCallback(pstMenuWnd->stSaveButton.u32WndDevSwitchSave, pstMenuWnd->stSaveButton.SaveProc);
					//SetWindowCallbackProc (pstMenuWnd->stSaveButton.u32WndDevSwitchSave, pstMenuWnd->stSaveButton.SaveProc);
				} else {
					QLOG(WRN, "设置界面保存按钮未注册回调函数\n");
				}
			}

#if 0

			unsigned int u32WndId = MINI_INTF_CreateWndTrackBar(WS_VISIBLE | LBS_NOTIFY,
												2222,
												150, 150, 250, 50,
												hWnd, 0,
												MINI_SET_WND_WindowTestProc);

			HDC hdc2 = GetDC(u32WndId);

			//SetBrushColor (hdc2, RGB2Pixel(hdc2, 0xff, 0, 0));

			//FillBox (hdc2, 0, 0, 350, 50);



			ReleaseDC (hdc);


#endif
		break;

		case MSG_COMMAND:
		{
			int id = LOWORD (wParam);
			int code = HIWORD (wParam);
			int sel;
			QLOG(TDBG, "列表窗口被点击 id[0x%x] code[0x%x]\n", id, code);
			switch (id) {

				/* 主按钮被点击*/
				case IDC_SET_BASIC_MENU:
					if (code == IVN_CLICKED) {

						sel = SendMessage (pstMenuWnd->stMainMenu.u32WndMenuMain, IVM_GETCURSEL, 0, 0);
						QLOG(TDBG, "clicking %d wParam[0x%x]\n", sel, wParam);
						MINI_SET_WND_Switch(hWnd, sel);
					}
					break;

				case IDC_SET_BASIC_LIST:
					if (code == IVN_CLICKED) {

						sel = SendMessage (pstMenuWnd->stCommonAttr.u32WndMenuList, SVM_GETCURSEL, 0, 0);
						QLOG(TDBG, "clicking basic set %d wParam[0x%x]\n", sel, wParam);
						//SendMessage (pstMenuWnd->u32WndMenuMain, IVM_SELECTITEM, sel, TRUE);
						//MINI_SET_WND_Switch(hWnd, sel);
					}
					break;
				case IDC_SET_BASIC_DEV_SWITCH: {
					QLOG(TDBG, "开关机属性页被点击 id[0x%x] code[0x%x] lParam[0x%lx]\n", id, code, lParam);
					}
					break;

				case IDC_SET_DEV_SWITCH_SAVE: {
					MINI_SET_WND_SaveParam(pstMainWnd);
				}
				break;
			}
		}
		break;

        case MSG_PAINT:
			QLOG(TDBG, "创建窗口\n");
           	hdc = MINI_API_BeginPaint(hWnd);
				//SetBrushColor (hdc, RGB2Pixel(hdc, 0xff, 0, 0));

				//FillBox (hdc, 150, 150, 350, 50);

            MINI_API_EndPaint (hWnd, hdc);
        	return 0;
        case MSG_CLOSE:
			QLOG(TDBG, "结束主界面\n");
			//DestroyLogFont(pstFont);
            MINI_API_DestroyMainWindow (hWnd);
            MINI_API_PostQuitMessage (hWnd);
            return 0;
    }

    return DefaultMainWinProc(hWnd, message, wParam, lParam);
}











void* MINI_SET_WindowCreate(void *pArg)
{

	WND_API_HANDLE_S *pstMainWnd = (WND_API_HANDLE_S *)pArg;

	WND_API_CreateFullScreenMainWnd(pstMainWnd,//(WND_API_HANDLE_S *)pArg,
										WS_VISIBLE | WS_BORDER,
										WS_EX_NONE, //WS_EX_AUTOSECONDARYDC
										MINI_SET_WND_WindowProc, COLOR_black, SW_SHOWNORMAL);

	return NULL;
}


int WND_SET_DestroyMainWnd(WND_API_HANDLE_S *pstMainWnd)
{
	MINI_SET_WND_S *pstMenuWnd = NULL;

	if(NULL == pstMainWnd) {
		QLOG(ERR, "未找到主界面\n");
		return -1;
	}

	pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	if(NULL == pstMenuWnd) {
		QLOG(ERR, "未找到主界面私有属性\n");
		return -1;
	}
	//DestroyWindow(u32SoftKeypadWnd);

	if(pstMenuWnd->stCommonAttr.bWndCreatList == true) {
		DestroyWindow(pstMenuWnd->stCommonAttr.u32WndMenuList);
		pstMenuWnd->stCommonAttr.bWndCreatList = false;
	}

	if(pstMenuWnd->stCommonAttr.bWndCreatCent == true) {
		DestroyWindow(pstMenuWnd->stCommonAttr.u32WndCent);
	}
	WND_API_DestroyMainWndMenuByIcon(pstMenuWnd->stMainMenu.u32WndMenuMain, stGlbIconSetMenu, sizeof(stGlbIconSetMenu) / sizeof(stGlbIconSetMenu[0]));

	//DestroyWindow(pstMenuWnd->u32WndMenuMain);
	DestroyMainWindow(pstMainWnd->stAttr.u32MainWnd);

	return 0;
}








#endif
























/*!
 * 刷新开关机属性页的参数
 * @return  0.成功 -1.失败
 * @param u32Wnd 开关机属性页的窗口id
 * @see
 */
int WND_SET_FlushDevSwitch(unsigned int u32Wnd)
{


	ALL_PARAM_S stParam;
	PCAR_POWER_S *pstPower = &stParam.stCar.stPower;
	//MINI_SET_WND_S *pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	char s8TempBuf[256];
	WND_WIDGET_S *pstWnd = (WND_WIDGET_S *)GetWindowAdditionalData(u32Wnd);
	//WND_ATTR_S *pstAttr = NULL;
	WND_WIDGET_S *pstWidgetWnd = NULL;
	WND_WIDGET_S *pstAttrPageWnd = NULL;

	if(pstWnd) {
		QLOG(TDBG, "获取到了[%s]的附加数据\n", pstWnd->stCommon.stAttr.s8Name);
	} else {
		QLOG(TDBG, "没有获取到了开关机属性表的附加数据\n");
		return -1;
	}

	int s32Ret;
	int s32WidgetNum, s32AttrPageNum;
	s32Ret = REDIS_GetParam(pstGlbRedisProc->pstRedisHandle, P_CAR_POWER, &stParam, NULL);
	if(s32Ret < 0) {
		QLOG(ERR, "REDIS_GetParam faild\n");
		return -1;
	}
	MINI_INTF_PSM_SetActiveByIndex(u32Wnd, 0);

	for(s32AttrPageNum = 0; s32AttrPageNum < pstWnd->s32WidgetNum; s32AttrPageNum++) {
		if(pstWnd->pstWidget) {
			pstAttrPageWnd = &pstWnd->pstWidget[s32AttrPageNum];
			if(pstAttrPageWnd) {
				for(s32WidgetNum = 0; s32WidgetNum < pstAttrPageWnd->s32WidgetNum; s32WidgetNum++) {
					if(pstAttrPageWnd->pstWidget) {
						pstWidgetWnd = &pstAttrPageWnd->pstWidget[s32WidgetNum];
						if(pstWidgetWnd->stCommon.stAttr.u32Id == WIDGET_ID_POWER_ON_MODE_E) {
							MINI_INTF_DropDownSetCursel(pstWidgetWnd->stCommon.stAttr.u32WndId, pstPower->u32StartupMode);
						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SET_OFF_MODE) {
							MINI_INTF_DropDownSetCursel(pstWidgetWnd->stCommon.stAttr.u32WndId, pstPower->u32ShutdownMode);
						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_START_DELAY_INPUT) {
							memset(s8TempBuf, 0, sizeof(s8TempBuf));
							snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32IgniteStartup);
							QLOG(TDBG, "点火开机延时[%s]\n", s8TempBuf);
							MINI_INTF_EditAddText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, strlen(s8TempBuf));

						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SHUTDOWN_DELAY_INPUT) {
							memset(s8TempBuf, 0, sizeof(s8TempBuf));
							snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32IgniteDown);
							MINI_INTF_EditAddText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, strlen(s8TempBuf));

						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_START_TIMING_INPUT) {
							memset(s8TempBuf, 0, sizeof(s8TempBuf));
							snprintf(s8TempBuf, sizeof(s8TempBuf), "%02u:%02u:%02u",
												(pstPower->u32TimedShutdownStime / (60*60)),
												(pstPower->u32TimedShutdownStime % (60*60)) / 60,
												(pstPower->u32TimedShutdownStime % (60*60)) % 60);
							MINI_INTF_EditAddText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, strlen(s8TempBuf));

						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_START_TIMING_INPUT2) {
							memset(s8TempBuf, 0, sizeof(s8TempBuf));
							snprintf(s8TempBuf, sizeof(s8TempBuf), "%02u:%02u:%02u",
												(pstPower->u32TimedShutdownEtime / (60*60)),
												(pstPower->u32TimedShutdownEtime % (60*60)) / 60,
												(pstPower->u32TimedShutdownEtime % (60*60)) % 60);

							MINI_INTF_SetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf);
						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SET_SLEEP_MODE_INPUT) {
							MINI_INTF_DropDownSetCursel(pstWidgetWnd->stCommon.stAttr.u32WndId, pstPower->u32SleepMode);
						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_LOW_INPUT) {
						 	if(pstPower->u32LowProtect == 1) {
								MINI_INTF_SetButtonCheck(pstWidgetWnd->stCommon.stAttr.u32WndId, BST_CHECKED);
								//SendMessage(pstWidgetWnd->stCommon.stAttr.u32WndId, BM_SETCHECK, BST_CHECKED, 0);
							} else {
								MINI_INTF_SetButtonCheck(pstWidgetWnd->stCommon.stAttr.u32WndId, BST_UNCHECKED);
								//SendMessage(pstWidgetWnd->stCommon.stAttr.u32WndId, BM_SETCHECK, BST_UNCHECKED, 0);
							}
					   } else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_BATT_LOW_INPUT) {
						 	memset(s8TempBuf, 0, sizeof(s8TempBuf));
							snprintf(s8TempBuf, sizeof(s8TempBuf), "%0.2f", pstPower->s32BatteryLowProtect);
							MINI_INTF_SetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf);

					   } else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_REST_VOL_INPUT) {
						 	memset(s8TempBuf, 0, sizeof(s8TempBuf));
							snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32RecoverySwitch);
							//MINI_INTF_EditAddText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, strlen(s8TempBuf));
							MINI_INTF_SetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf);
					   } else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_LOW_REP_INPUT) {
						 	if(pstPower->u32LowVoltageReporting == 1) {
								MINI_INTF_SetButtonCheck(pstWidgetWnd->stCommon.stAttr.u32WndId, BST_CHECKED);
								//SendMessage(pstWidgetWnd->stCommon.stAttr.u32WndId, BM_SETCHECK, BST_CHECKED, 0);
							} else {
								MINI_INTF_SetButtonCheck(pstWidgetWnd->stCommon.stAttr.u32WndId, BST_UNCHECKED);
								//SendMessage(pstWidgetWnd->stCommon.stAttr.u32WndId, BM_SETCHECK, BST_UNCHECKED, 0);
							}
					   } else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_IGN_DELAY_INPUT) {
						 	memset(s8TempBuf, 0, sizeof(s8TempBuf));
							snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32IgniteSleepDelay);
							MINI_INTF_SetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf);
					   } else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_OUTAGE_MODE_INPUT) {
						 	memset(s8TempBuf, 0, sizeof(s8TempBuf));
							snprintf(s8TempBuf, sizeof(s8TempBuf), "%u", pstPower->u32OutageDelay);
							QLOG(TDBG, "断电模式延时 0-60秒 [%s] [%s]\n", s8TempBuf, pstWidgetWnd->stCommon.stAttr.s8Name);
							MINI_INTF_SetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf);

							//SendMessage(pstWidgetWnd->stCommon.stAttr.u32WndId, MSG_SETTEXT, (LPARAM)strlen(s8TempBuf), (LPARAM)s8TempBuf);
					   }

					}
				}
			}
		}
	}

	return 0;
}





/*!
 * 保存开关机页面的参数
 * @return  0.成功 -1.失败
 * @param u32Wnd 开关机页面的窗口id
 * @see
 */
int WND_SET_SaveDevSwitch(unsigned int u32Wnd)
{


	ALL_PARAM_S stParam;
	PCAR_POWER_S *pstPower = &stParam.stCar.stPower;
	//MINI_SET_WND_S *pstMenuWnd = (MINI_SET_WND_S *)pstMainWnd->stAttr.pAri;
	char s8TempBuf[256];
	WND_WIDGET_S *pstWnd = (WND_WIDGET_S *)GetWindowAdditionalData(u32Wnd);
	//WND_ATTR_S *pstAttr = NULL;
	WND_WIDGET_S *pstWidgetWnd = NULL;
	WND_WIDGET_S *pstAttrPageWnd = NULL;
	REDIS_MSG_RES_S stMsgRes;
	unsigned u32Hour, u32Min, u32Sec;
	int s32Ret;
	int s32WidgetNum, s32AttrPageNum;

	if(pstWnd) {
		QLOG(TDBG, "获取到了[%s]的附加数据\n", pstWnd->stCommon.stAttr.s8Name);
	} else {
		QLOG(TDBG, "没有获取到了开关机属性表的附加数据\n");
		return -1;
	}


	s32Ret = REDIS_GetParam(pstGlbRedisProc->pstRedisHandle, P_CAR_POWER, &stParam, NULL);
	if(s32Ret < 0) {
		QLOG(ERR, "REDIS_GetParam faild\n");
		return -1;
	}


	for(s32AttrPageNum = 0; s32AttrPageNum < pstWnd->s32WidgetNum; s32AttrPageNum++) {
		if(pstWnd->pstWidget) {
			pstAttrPageWnd = &pstWnd->pstWidget[s32AttrPageNum];
			if(pstAttrPageWnd) {
				for(s32WidgetNum = 0; s32WidgetNum < pstAttrPageWnd->s32WidgetNum; s32WidgetNum++) {
					if(pstAttrPageWnd->pstWidget) {
						pstWidgetWnd = &pstAttrPageWnd->pstWidget[s32WidgetNum];
						if(pstWidgetWnd->stCommon.stAttr.u32Id == WIDGET_ID_POWER_ON_MODE_E) {
							//MINI_INTF_DropDownSetCursel(pstWidgetWnd->stCommon.stAttr.u32WndId, pstPower->u32StartupMode);

							pstPower->u32StartupMode = MINI_INTF_DropDownGetCursel(pstWidgetWnd->stCommon.stAttr.u32WndId);
							if(pstPower->u32StartupMode < 0) {
								QLOG(ERR, "IDC_SET_STAR_UP_MODE MBM_GETCURITEM faild[%d]\n", pstPower->u32StartupMode);
								return -1;
							}
						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SET_OFF_MODE) {
							//MINI_INTF_DropDownSetCursel(pstWidgetWnd->stCommon.stAttr.u32WndId, pstPower->u32ShutdownMode);
							pstPower->u32ShutdownMode = MINI_INTF_DropDownGetCursel(pstWidgetWnd->stCommon.stAttr.u32WndId);
							if(pstPower->u32ShutdownMode < 0) {
								QLOG(ERR, "IDC_SET_STAR_UP_MODE MBM_GETCURITEM faild[%d]\n", pstPower->u32StartupMode);
								return -1;
							}
						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_START_DELAY_INPUT) {

							memset(&s8TempBuf, 0, sizeof(s8TempBuf));
							MINI_INTF_GetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, sizeof(s8TempBuf));

							//SendMessage(pstWidgetWnd->stCommon.stAttr.u32WndId, MSG_GETTEXT, (LPARAM)sizeof(s8TempBuf), (LPARAM)s8TempBuf);
							sscanf(s8TempBuf, "%u", &pstPower->u32IgniteStartup);
							QLOG(TDBG, "点火开机延时[%u]\n", pstPower->u32IgniteStartup);

						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SHUTDOWN_DELAY_INPUT) {
							memset(&s8TempBuf, 0, sizeof(s8TempBuf));
							MINI_INTF_GetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, sizeof(s8TempBuf));
							sscanf(s8TempBuf, "%u", &pstPower->u32IgniteDown);

						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_START_TIMING_INPUT) {

							memset(&s8TempBuf, 0, sizeof(s8TempBuf));
							u32Hour = 0;
							u32Min = 0;
							u32Sec = 0;
							MINI_INTF_GetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, sizeof(s8TempBuf));
							sscanf(s8TempBuf, "%u:%u:%u", &u32Hour, &u32Min, &u32Sec);
							pstPower->u32TimedShutdownStime = u32Hour*60*60 + u32Min * 60 + u32Sec;



						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_START_TIMING_INPUT2) {

							memset(&s8TempBuf, 0, sizeof(s8TempBuf));
							u32Hour = 0;
							u32Min = 0;
							u32Sec = 0;
							MINI_INTF_GetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, sizeof(s8TempBuf));
							sscanf(s8TempBuf, "%u:%u:%u", &u32Hour, &u32Min, &u32Sec);
							pstPower->u32TimedShutdownEtime = u32Hour*60*60 + u32Min * 60 + u32Sec;
						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SET_SLEEP_MODE_INPUT) {
							//MINI_INTF_DropDownSetCursel(pstWidgetWnd->stCommon.stAttr.u32WndId, pstPower->u32SleepMode);

							pstPower->u32SleepMode = MINI_INTF_DropDownGetCursel(pstWidgetWnd->stCommon.stAttr.u32WndId);
							if(pstPower->u32SleepMode < 0) {
								QLOG(ERR, "IDC_SET_STAR_UP_MODE MBM_GETCURITEM faild[%d]\n", pstPower->u32StartupMode);
								return -1;
							}
						} else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_LOW_INPUT) {
							s32Ret = MINI_INTF_GetiButtonCheck(pstWidgetWnd->stCommon.stAttr.u32WndId);
							if(s32Ret == BST_CHECKED) {
								pstPower->u32LowProtect = 1;
							} else if(s32Ret == BST_UNCHECKED){
								pstPower->u32LowProtect = 0;
							}
					   } else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_BATT_LOW_INPUT) {
							memset(&s8TempBuf, 0, sizeof(s8TempBuf));
							MINI_INTF_GetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, sizeof(s8TempBuf));
							sscanf(s8TempBuf, "%f", &pstPower->s32BatteryLowProtect);

					   } else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_REST_VOL_INPUT) {
							memset(&s8TempBuf, 0, sizeof(s8TempBuf));
							MINI_INTF_GetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, sizeof(s8TempBuf));
							sscanf(s8TempBuf, "%u", &pstPower->u32RecoverySwitch);

					   } else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_LOW_REP_INPUT) {
							s32Ret = MINI_INTF_GetiButtonCheck(pstWidgetWnd->stCommon.stAttr.u32WndId);
							if(s32Ret == BST_CHECKED) {
								pstPower->u32LowVoltageReporting = 1;
							} else if(s32Ret == BST_UNCHECKED){
								pstPower->u32LowVoltageReporting = 0;
							}
					   } else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_IGN_DELAY_INPUT) {
							memset(&s8TempBuf, 0, sizeof(s8TempBuf));
							MINI_INTF_GetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, sizeof(s8TempBuf));
							sscanf(s8TempBuf, "%u", &pstPower->u32IgniteSleepDelay);
					   } else if(pstWidgetWnd->stCommon.stAttr.u32Id == IDC_SLEEP_OUTAGE_MODE_INPUT) {
							memset(&s8TempBuf, 0, sizeof(s8TempBuf));
							MINI_INTF_GetWindowText(pstWidgetWnd->stCommon.stAttr.u32WndId, s8TempBuf, sizeof(s8TempBuf));
							sscanf(s8TempBuf, "%u", &pstPower->u32OutageDelay);
					   }

					}
				}
			}
		}
	}

	memset(&stMsgRes, 0, sizeof(stMsgRes));
	s32Ret = REDIS_SetSendAndWait(pstGlbRedisProc->pstRedisHandle, P_CAR_POWER, &stParam, RMSG_SYS_POWER, &stMsgRes, 5);
	if(s32Ret < 0 || stMsgRes.s32Res < 0) {
		QLOG(ERR, "REDIS_SetSendAndWait faild s32Ret[%d] s32Res[%d]\n", s32Ret, stMsgRes.s32Res);
		return -1;
	} else {
		WND_DLG_CreatById(WND_DLG_TYPE_OK, u32Wnd);
	}

	return 0;
}












/*!
 * 设置界面回调函数
 *
 */
int WND_SET_Proc(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
    HDC u32Hdc;

	WND_WIDGET_S *pstWnd = (WND_WIDGET_S *)GetWindowAdditionalData(u32Wnd);
	//WND_WIDGET_S *pstShowMenuWnd = NULL;
	//WND_WIDGET_S *pstShowListWnd = NULL;
	//WND_WIDGET_S *pstShowAttrWnd = NULL;
	//int s32Num, s32ListNum, s32List, s32AttrNum, s32Attr;
	//WND_WIDGET_S *pstCtrl = NULL;
	unsigned int u32WidgetWnd;

    switch (s32Message) {
		case MSG_CREATE: {
			pstWnd->stCommon.stAttr.u32WndId = u32Wnd;
			if(pstWnd) {
				WND_WIDGET_CreateById(pstWnd, u32Wnd, IDC_SET_CTRL_SETS);
				WND_WIDGET_CreateById(pstWnd, u32Wnd, IDC_SET_BASIC_LIST);
				u32WidgetWnd = WND_WIDGET_CreateById(pstWnd, u32Wnd, IDC_SET_BASIC_DEV_SWITCH);
				WND_SET_FlushDevSwitch(u32WidgetWnd);
#if 0
				for(s32Num = 0; s32Num < pstWnd->s32WidgetNum; s32Num++) {

					pstShowMenuWnd = &pstWnd->pstWidget[s32Num];

					/* 找到设置菜单*/
					if(pstShowMenuWnd->stCommon.stAttr.u32Id == WND_SET_GROP_MENU) {
						WND_WIDGET_Create(pstShowMenuWnd, pstWnd->stCommon.stAttr.u32WndId);

						/* 找到设置菜单子控件*/
						if(pstShowMenuWnd->pstWidget && pstShowMenuWnd->s32WidgetNum > 0) {

							for(s32ListNum = 0; s32ListNum < pstShowMenuWnd->s32WidgetNum; s32ListNum++) {
								pstShowListWnd = &pstShowMenuWnd->pstWidget[s32ListNum];
								if(pstShowListWnd->stCommon.stAttr.u32Id == DEV_SET_BASIC_SET_E) {

									/* 创建基础设置列表*/
									if(pstShowListWnd->pstWidget && pstShowListWnd->s32WidgetNum > 0) {
										for(s32List = 0; s32List < pstShowListWnd->s32WidgetNum; s32List++) {

											QLOG(TDBG, "创建[%s]\n", pstShowListWnd->pstWidget[s32List].stCommon.stAttr.s8Name);
											WND_WIDGET_Create(&pstShowListWnd->pstWidget[s32List], u32Wnd);
											if(pstShowListWnd->pstWidget[s32List].stCommon.stAttr.u32Id) {
												for(s32AttrNum = 0; s32AttrNum < pstShowListWnd->pstWidget[s32List].s32WidgetNum;s32AttrNum++) {
													pstShowAttrWnd = &pstShowListWnd->pstWidget[s32List].pstWidget[s32AttrNum];
													if(pstShowAttrWnd->stCommon.stAttr.u32Id == BASIC_MSG_DEV_ON_OFF_E) {

														/* 创建属性表*/
														QLOG(TDBG, "创建[%s]\n", pstShowAttrWnd->pstWidget[s32Attr].stCommon.stAttr.s8Name);
														for(s32Attr; s32Attr < pstShowAttrWnd->s32WidgetNum; s32Attr++) {
															WND_WIDGET_Create(&pstShowAttrWnd->pstWidget[s32Attr], u32Wnd);
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
#endif
			}
		}
		break;
		case MSG_INITDIALOG:

		break;
		case MSG_COMMAND:

		break;
        case MSG_PAINT:
			//QLOG(TDBG, "创建窗口\n");
           	u32Hdc = BeginPaint(u32Wnd);

            EndPaint (u32Wnd, u32Hdc);
        	return 0;
        case MSG_CLOSE:
			QLOG(TDBG, "结束主界面\n");
            DestroyMainWindow (u32Wnd);
            PostQuitMessage (u32Wnd);
            return 0;
    }

    return DefaultMainWinProc(u32Wnd, s32Message, u32Param, u64Param);
}


/*!
 * 删除一个窗口的同一个父窗口下的其余所有窗口
 * @param u32Wnd 除了这个窗口外都删除
 * @see
 */
void WND_SET_DestroyOther(unsigned int u32Wnd)
{
	int s32Num;
	int s32DestroyNum;
	WND_WIDGET_S *pstParentWnd = (WND_WIDGET_S *)GetWindowAdditionalData(GetParent(u32Wnd));
	if(pstParentWnd) {
		for(s32Num = 0; s32Num < pstParentWnd->s32WidgetNum; s32Num++) {
			if(pstParentWnd->pstWidget) {
				if(pstParentWnd->pstWidget[s32Num].stCommon.stAttr.u32WndId != u32Wnd) {
					if(pstParentWnd->pstWidget[s32Num].pstWidget) {
						for(s32DestroyNum = 0; s32DestroyNum < pstParentWnd->pstWidget[s32Num].s32WidgetNum; s32DestroyNum++) {
							WND_WIDGET_Destroy(&pstParentWnd->pstWidget[s32Num].pstWidget[s32DestroyNum]);
						}
					}
				}
			}
		}
	}
}


/*!
 * 基础设置回调函数
 *
 */
int WND_SET_CallBackBasicSet(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "基础设置\n");

	WND_WIDGET_S *pstWnd = (WND_WIDGET_S *)GetWindowAdditionalData(u32Wnd);
	int s32Num;
	WND_WIDGET_S *pstCtrl = NULL;
	unsigned int u32WidgetWnd;

	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	//WND_WIDGET_CreateById(pstWnd, GetParent(pstWnd->stCommon.stAttr.u32ParentWndId), IDC_SET_BASIC_DEV_SWITCH);
	//WND_SET_DestroyOther(u32Wnd);
	WND_SET_DestroyOther(u32Wnd);

	if(pstWnd) {
		for(s32Num = 0; s32Num < pstWnd->s32WidgetNum; s32Num++) {
			pstCtrl = &pstWnd->pstWidget[s32Num];
			//if(pstCtrl->stCommon.stAttr.u32Id == DEV_SET_BASIC_SET_E) {
			if(pstCtrl->stCommon.stAttr.u32Id == IDC_SET_BASIC_LIST) {

				WND_WIDGET_Create(&pstWnd->pstWidget[s32Num], GetParent(pstWnd->stCommon.stAttr.u32ParentWndId));
				u32WidgetWnd = WND_WIDGET_CreateById(&pstWnd->pstWidget[s32Num], GetParent(pstWnd->stCommon.stAttr.u32ParentWndId), IDC_SET_BASIC_DEV_SWITCH);
				WND_SET_FlushDevSwitch(u32WidgetWnd);
			}
		}
	}

	return 0;


}

/*!
 * 视频设置回调函数
 *
 */
int WND_SET_CallBackVideoSet(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "视频设置\n");
	WND_SET_DestroyOther(u32Wnd);
	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);

	return 0;

}

/*!
 * 数据采集回调函数
 *
 */
int WND_SET_CallBackGetDate(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "数据采集\n");
	WND_SET_DestroyOther(u32Wnd);
	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);

	return 0;

}

/*!
 * 报警设置回调函数
 *
 */
int WND_SET_CallBackAlarmSet(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "报警设置\n");
	WND_SET_DestroyOther(u32Wnd);
	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);

	return 0;

}

/*!
 * 设备维护回调函数
 *
 */
int WND_SET_CallBackDevSet(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "设备维护\n");
	WND_SET_DestroyOther(u32Wnd);
	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	return 0;

}


/*!
 * 返回回调函数
 *
 */
int WND_SET_CallBackReturn(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "返回\n");
	//MAIN_WND_Destroy(&stGlbMainModule, MAIN_WND_TYPE_SET_E);
	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	WND_HANDLE_Destroy(MAIN_WND_TYPE_SET_E);

	return 0;

}


/*!
 * 基础设置列表回调函数
 *
 */
int WND_SET_CallBackBasicSetList(HWND hWnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{

	switch (s32Message) {

		case MSG_COMMAND:
			QLOG(TDBG, "基础设置列表\n");

		break;

		case EN_SETFOCUS:{
			QLOG(TDBG, "输入界面有变化\n");
			break;
		}


		case MSG_PAINT:
		{
			//QLOG(TDBG, "22222\n");
			HDC hdc = BeginPaint (hWnd);

			EndPaint (hWnd, hdc);


			return 0;
		}
	}
	return DefaultContainerProc(hWnd, s32Message, u32Param, u64Param);

}

/*!
 * 注册消息回调函数
 *
 */
int WND_SET_CallBackBasicListRegister(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{

	QLOG(TDBG, "注册消息 [0x%x]  [0x%x]\n", s32Message, u32Param);


	int s32Id = 0;
	int s32Code = 0;
	switch (s32Message) {
		case BASIC_MSG_REGISTER_E: {

			s32Id = LOWORD (u32Param);
			s32Code = HIWORD (u32Param);
			switch (s32Id) {
				case BN_CLICKED:
					WND_SET_DestroyOther(u32Wnd);
					WND_WIDGET_FlushButtonCursel(u32Wnd);
				break;
			}
		}
	}

	return  0;
}

/*!
 * 时间设置回调函数
 *
 */
int WND_SET_CallBackBasicListTimeSet(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{


	QLOG(TDBG, "时间设置[0x%x] [0x%x]\n", s32Message, u32Param);
	int s32Id = 0;
	int s32Code = 0;
	switch (s32Message) {
		case BASIC_MSG_TIME_E: {

			s32Id = LOWORD (u32Param);
			s32Code = HIWORD (u32Param);
			switch (s32Id) {
				case BN_CLICKED:
					WND_SET_DestroyOther(u32Wnd);
					WND_WIDGET_FlushButtonCursel(u32Wnd);
				break;
			}
		}
	}


	return  0;
}

/*!
 * 开关机回调函数
 *
 */
int WND_SET_CallBackBasicListDevOnOff(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{

	QLOG(TDBG, "开关机[0x%x] [0x%x]\n", s32Message, u32Param);

	WND_WIDGET_S *pstWnd = (WND_WIDGET_S *)GetWindowAdditionalData(u32Wnd);

	//WND_WIDGET_S *pstParentWnd = (WND_WIDGET_S *)GetWindowAdditionalData(pstWnd->stCommon.stAttr.u32ParentWndId);
	//GetParent(hWnd)


	int s32Num;
	WND_WIDGET_S *pstCtrl = NULL;
	int id = 0;
	int code = 0;
	switch (s32Message) {
		case BASIC_MSG_DEV_ON_OFF_E: {

			id = LOWORD (u32Param);
			code = HIWORD (u32Param);
			switch (id) {
				case BN_CLICKED:
					WND_SET_DestroyOther(u32Wnd);
					WND_WIDGET_FlushButtonCursel(u32Wnd);
					if(pstWnd) {
						for(s32Num = 0; s32Num < pstWnd->s32WidgetNum; s32Num++) {
							pstCtrl = &pstWnd->pstWidget[s32Num];
							if(pstCtrl->stCommon.stAttr.u32Group == BASIC_MSG_DEV_ON_OFF_ATTR_PAGE_E) {
								QLOG(TDBG, "找到属性页\n");
								//pstCtrl->stCommon.stAttr.u32ParentWndId = pstWnd->stCommon.stAttr.u32ParentWndId;
								//pstCtrl->stCommon.stAttr.u32ParentWndId = GetParent(GetParent(GetParent(u32Wnd)));
								//WND_WIDGET_Create(&pstWnd->pstWidget[s32Num], GetParent(GetParent(GetParent(u32Wnd))));
								WND_WIDGET_Create(&pstWnd->pstWidget[s32Num], GetParent(GetParent(u32Wnd)));
							}
						}
					} else {
						QLOG(TDBG, "附加数据为空\n");
					}
				break;
			}
		}
	}


	return  0;
}


/*!
 * 用户设置回调函数
 *
 */
int WND_SET_CallBackBasicListUser(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{

	QLOG(TDBG, "用户设置\n");

	int s32Id = 0;
	int s32Code = 0;
	switch (s32Message) {
		case BASIC_MSG_USER_E: {

			s32Id = LOWORD (u32Param);
			s32Code = HIWORD (u32Param);
			switch (s32Id) {
				case BN_CLICKED:
					WND_SET_DestroyOther(u32Wnd);
					WND_WIDGET_FlushButtonCursel(u32Wnd);
				break;
			}
		}
	}


	return  0;
}

/*!
 * 网络设置界面回调函数
 *
 */
int WND_SET_CallBackBasicListNet(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{

	QLOG(TDBG, "网络设置\n");
	int s32Id = 0;
	int s32Code = 0;
	switch (s32Message) {
		case BASIC_MSG_NET_E: {

			s32Id = LOWORD (u32Param);
			s32Code = HIWORD (u32Param);
			switch (s32Id) {
				case BN_CLICKED:
					WND_SET_DestroyOther(u32Wnd);
					WND_WIDGET_FlushButtonCursel(u32Wnd);
				break;
			}
		}
	}


	return  0;
}

/*!
 * "网络应用界面回调函数
 *
 */
int WND_SET_CallBackBasicListNetApp(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{

	QLOG(TDBG, "网络应用\n");
	int s32Id = 0;
	int s32Code = 0;

	switch (s32Message) {
		case BASIC_MSG_NET_APP_E: {

			s32Id = LOWORD (u32Param);
			s32Code = HIWORD (u32Param);
			switch (s32Id) {
				case BN_CLICKED:
					WND_SET_DestroyOther(u32Wnd);
					WND_WIDGET_FlushButtonCursel(u32Wnd);
				break;
			}
		}
	}


	return  0;
}





/*!
 * 开关机属性页回调函数
 *
 */
static int MINI_SET_WND_AttrPageProcPowerOnOff(HWND hDlg, int s32Message, WPARAM u32Param, LPARAM u64Param)
{


	int id = 0;
	int code = 0;
	//QLOG(TDBG, "开关机属性表回调\n");

	switch (s32Message) {
	case MSG_INITPAGE:
		/* 获取属性页中静态框的句柄 */
		break;

	case MSG_SHEETCMD:
		QLOG(TDBG, "属性表切换\n");
		if (u64Param == IDOK)
			/* 用户单击对话框中的“刷新”按钮时，将调用该函数刷新 */
			//get_systeminfo(hDlg);


		return 0;

	case MSG_COMMAND: {

		id = LOWORD (u32Param);
		code = HIWORD (u32Param);

		}
	}
	return DefaultPageProc(hDlg, s32Message, u32Param, u64Param);
}

/*!
 * 休眠属性页回调函数
 *
 */
static int MINI_SET_WND_AttrPageProcPowerSleep(HWND hDlg, int s32Message, WPARAM u32Param, LPARAM u64Param)
{


	int id = 0;
	int code = 0;
	//QLOG(TDBG, "休眠属性表回调\n");

	switch (s32Message) {
	case MSG_INITPAGE:
		/* 获取属性页中静态框的句柄 */
		break;

	case MSG_SHEETCMD:
		QLOG(TDBG, "属性表切换\n");
		if (u32Param == IDOK)
			/* 用户单击对话框中的“刷新”按钮时，将调用该函数刷新 */
			//get_systeminfo(hDlg);


		return 0;

	case MSG_COMMAND: {

		id = LOWORD (u32Param);
		code = HIWORD (u32Param);

		}
	}
	return DefaultPageProc(hDlg, s32Message, u32Param, u64Param);
}


/*!
 * 休眠属性页回调函数
 *
 */
int WND_SET_CallBackAttrPageSleep(HWND hWnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{

	QLOG(TDBG, "休眠属性页保存按钮回调函数\n");

	//WND_WIDGET_S *pstWnd = (WND_WIDGET_S *)GetWindowAdditionalData(hWnd);
	WND_WIDGET_S *pstParentWnd = (WND_WIDGET_S *)GetWindowAdditionalData(GetParent(hWnd));
	if(pstParentWnd) {
		QLOG(TDBG, "11111111111111111 [%s]\n", pstParentWnd->stCommon.stAttr.s8Name);
		WND_SET_SaveDevSwitch(GetParent(GetParent(hWnd)));
	} else {

		QLOG(TDBG, "222222222222222222222\n");

	}

	return  0;
}


/*!
 * 编辑框回调函数
 *
 */
static int WND_SET_EditProc(HWND hDlg, int s32Message, WPARAM u32Param, LPARAM u64Param)
{


	int id = 0;
	int code = 0;

	id = LOWORD (u32Param);
	code = HIWORD (u32Param);

	switch(id) {
		case EN_KILLFOCUS:
			QLOG(TDBG, "隐藏 键盘\n");
			ShowWindow(stGlbMainWndHandle.u32SoftKeyWndId, SW_HIDE);
			return 0;
		case EN_SETFOCUS:
			QLOG(TDBG, "显示键盘\n");
			ShowWindow(stGlbMainWndHandle.u32SoftKeyWndId, SW_SHOWNORMAL);
			return 0;
	}
	return 0;
}



WIDGET_DROP_DOWN_ITM_S stGlbDevOnModeDropDownItm[] = {
	{.ps8Name = "点火"},
	{.ps8Name = "定时"},
	{.ps8Name = "点火或定时"},
	{.ps8Name = "点火休眠"},
};

WIDGET_DROP_DOWN_ITM_S stGlbDevOffModeDropDownItm[] = {
	//{.ps8Name = "点火不关机"},
	//{.ps8Name = "点火关机"},
	{.ps8Name = "点火"},
	{.ps8Name = "定时"},
	{.ps8Name = "点火或定时"},
	{.ps8Name = "点火休眠"},
};


WND_WIDGET_S stGlbAttrPageDevOnOffInfoCtrl[] = {


	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "开机方式",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_STAR_UP_INFO,
				.u32WndX = (UI_COORD_MAX * 1)/20,
				.u32WndY = (UI_COORD_MAX * 1)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_DROP_DOWN_E,
		.unPrivate = {
			.stDropDown = {
				.s32ListHeight = (UI_COORD_MAX * 1)/8,
				.pstItm = stGlbDevOnModeDropDownItm,
				.s32Num = sizeof(stGlbDevOnModeDropDownItm)/sizeof(stGlbDevOnModeDropDownItm[0]),
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_CHILD | WS_VISIBLE | MBS_ALIGNCENTER|MBS_NOBUTTON|WS_BORDER,
				//.u64ExStyle = WS_EX_NONE,
				.u32Id = WIDGET_ID_POWER_ON_MODE_E,
				.u32WndX = (UI_COORD_MAX * 8)/20,
				.u32WndY = (UI_COORD_MAX * 1)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/12,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
				.stFont = {
					.s32FontSize = 20,
				},
			},
			.stFops = {
				//.CallBack = WND_SET_EditProc,
			},
		},
	},




	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "关机方式",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_STAR_UP_INFO,
				.u32WndX = (UI_COORD_MAX * 1)/20,
				.u32WndY = (UI_COORD_MAX * 3)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},
#if 1
	{
		.enType = WND_WIDGET_TYPE_DROP_DOWN_E,
		.unPrivate = {
			.stDropDown = {
				.s32ListHeight = (UI_COORD_MAX * 1)/8,
				.pstItm = stGlbDevOffModeDropDownItm,
				.s32Num = sizeof(stGlbDevOffModeDropDownItm)/sizeof(stGlbDevOffModeDropDownItm[0]),
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				//.u64Style = WS_CHILD | WS_VISIBLE | MBS_ALIGNCENTER|MBS_NOBUTTON|WS_BORDER,
				//.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_OFF_MODE,
				.u32WndX = (UI_COORD_MAX * 8)/20,
				.u32WndY = (UI_COORD_MAX * 3)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/12,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
				.stFont = {
					.s32FontSize = 20,
				},
			},
			.stFops = {
				//.CallBack = WND_SET_EditProc,
			},
		},
	},


	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "点火开机延时",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_START_DELAY_INFO,
				.u32WndX = (UI_COORD_MAX * 1)/20,
				.u32WndY = (UI_COORD_MAX * 5)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/10,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},


	{
		.enType = WND_WIDGET_TYPE_EDIT_E,
		.unPrivate = {
			.stEdit = {
				.u32Type = 0,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				//.u64Style = WS_CHILD | WS_VISIBLE |WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_START_DELAY_INPUT,
				.u32WndX = (UI_COORD_MAX * 8)/20,
				.u32WndY = (UI_COORD_MAX * 5)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/12,
				.enBkColor = UI_COLOR_LIGHTWHITE_E,
				.bShowNow = true,
				.bBorder = true,
				.stFont = {
					.enFontColor = UI_COLOR_BLACK_E,
				},
			},
			.stFops = {
				.CallBack = WND_SET_EditProc,
			},
		},
	},


	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "(0~60)秒",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_STAR_UP_INFO,
				.u32WndX = (UI_COORD_MAX * 14)/20,
				.u32WndY = (UI_COORD_MAX * 5)/20,
				.u32WndWidth = (UI_COORD_MAX * 2)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},




	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "点火关机延时",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SHUTDOWN_DELAY_INFO,
				.u32WndX = (UI_COORD_MAX * 1)/20,
				.u32WndY = (UI_COORD_MAX * 7)/20,
				.u32WndWidth = (UI_COORD_MAX * 4)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_EDIT_E,
		.unPrivate = {
			.stEdit = {
				.u32Type = 0,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				//.u32WndId = ,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_CHILD | WS_VISIBLE |WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SHUTDOWN_DELAY_INPUT,
				.u32WndX = (UI_COORD_MAX * 8)/20,
				.u32WndY = (UI_COORD_MAX * 7)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/12,
				.enBkColor = UI_COLOR_LIGHTWHITE_E,
				.bShowNow = true,
				.bBorder = true,
				.stFont = {
					.enFontColor = UI_COLOR_BLACK_E,
				},
			},
			.stFops = {
				.CallBack = WND_SET_EditProc,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "(0~86399)秒",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SHUTDOWN_DELAY_INFO2,
				.u32WndX = (UI_COORD_MAX * 14)/20,
				.u32WndY = (UI_COORD_MAX * 7)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},



	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "定时开机时间",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_START_TIMING_INFO,
				.u32WndX = (UI_COORD_MAX * 1)/20,
				.u32WndY = (UI_COORD_MAX * 9)/20,
				.u32WndWidth = (UI_COORD_MAX * 4)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_EDIT_E,
		.unPrivate = {
			.stEdit = {
				.u32Type = 0,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				//.u32WndId = ,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				//.u64Style = WS_CHILD | WS_VISIBLE |WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_START_TIMING_INPUT,
				.u32WndX = (UI_COORD_MAX * 8)/20,
				.u32WndY = (UI_COORD_MAX * 9)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/12,
				.enBkColor = UI_COLOR_LIGHTWHITE_E,
				.bShowNow = true,
				.bBorder = true,
				.stFont = {
					.enFontColor = UI_COLOR_BLACK_E,
				},
			},
			.stFops = {
				.CallBack = WND_SET_EditProc,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "到",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_START_TIMING_INFO2,
				.u32WndX = (UI_COORD_MAX * 13)/20,
				.u32WndY = (UI_COORD_MAX * 9)/20,
				.u32WndWidth = (UI_COORD_MAX * 1)/15,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,

			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},


	{
		.enType = WND_WIDGET_TYPE_EDIT_E,
		.unPrivate = {
			.stEdit = {
				.u32Type = 0,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				//.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				//.u64Style = WS_CHILD | WS_VISIBLE |WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_START_TIMING_INPUT2,
				.u32WndX = (UI_COORD_MAX * 14)/20,
				.u32WndY = (UI_COORD_MAX * 9)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/12,
				.enBkColor = UI_COLOR_LIGHTWHITE_E,
				.bShowNow = true,
				.bBorder = true,
				.stFont = {
					.enFontColor = UI_COLOR_BLACK_E,
				},
			},
			.stFops = {
				.CallBack = WND_SET_EditProc,
			},
		},
	},


	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "保存",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_VISIBLE | BS_DEFPUSHBUTTON | WS_TABSTOP | WS_GROUP,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_DEV_SWITCH_SAVE,
				.u32WndX = (UI_COORD_MAX * 15)/20,
				.u32WndY = (UI_COORD_MAX * 15)/20,
				.u32WndWidth = (UI_COORD_MAX * 2)/20,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
				.stFont = {
					.s32FontSize = 20,
				},
			},
			.stFops = {
				.CallBack = WND_SET_CallBackAttrPageSleep,
			},
		},
	},
#endif
};







WIDGET_DROP_DOWN_ITM_S stGlbDevSleepModeDropDownItm[] = {
	{.ps8Name = "不休眠"},
	{.ps8Name = "点火休眠"},
	{.ps8Name = "断电休眠"},
};

WND_WIDGET_S stGlbAttrPageDevOnOffSleepInfoCtrl[] = {


	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "休眠模式",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_STAR_UP_INFO,
				.u32WndX = (UI_COORD_MAX * 1)/20,
				.u32WndY = (UI_COORD_MAX * 1)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_DROP_DOWN_E,
		.unPrivate = {
			.stDropDown = {
				.s32ListHeight = (UI_COORD_MAX * 1)/8,
				.pstItm = stGlbDevSleepModeDropDownItm,
				.s32Num = sizeof(stGlbDevSleepModeDropDownItm)/sizeof(stGlbDevSleepModeDropDownItm[0]),
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				//.u64Style = WS_CHILD | WS_VISIBLE | MBS_ALIGNCENTER|MBS_NOBUTTON|WS_BORDER,
				//.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_SLEEP_MODE_INPUT,
				.u32WndX = (UI_COORD_MAX * 8)/20,
				.u32WndY = (UI_COORD_MAX * 1)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/12,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
				.stFont = {
					.s32FontSize = 20,
				},
			},
			.stFops = {
				//.CallBack = WND_SET_CallBackAttrPageSleep,
			},
		},
	},


	{
			.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,

			.stCommon = {
				.stAttr = {
					.s8Name = "低电压保护",
					.u32WndId = 0,
					.u32Group = 0,
					//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
					.u64ExStyle = WS_EX_NONE,
					.u32Id = IDC_SET_STAR_UP_INFO,
					.u32WndX = (UI_COORD_MAX * 1)/20,
					.u32WndY = (UI_COORD_MAX * 3)/20,
					.u32WndWidth = (UI_COORD_MAX * 3)/12,
					.u32WndHeight = (UI_COORD_MAX * 1)/10,
					.enBkColor = UI_COLOR_DEFAULT_E,
					.bShowNow = true,
					//.bBorder = true,
				},
				.stFops = {
					//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
				},
			},
		},
#if 1

	{
		.enType = WND_WIDGET_TYPE_MULTI_BUTTON_E,
		.unPrivate = {
			.stMultiButton = {
				.s32AutoCheck = 1,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_STAR_UP_INFO,
				.u32WndX = (UI_COORD_MAX * 8)/20,
				.u32WndY = (UI_COORD_MAX * 3)/20,
				.u32WndWidth = (UI_COORD_MAX * 1)/30,
				.u32WndHeight = (UI_COORD_MAX * 1)/20,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},



	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "蓄电池低电压保护",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_STAR_UP_INFO,
				.u32WndX = (UI_COORD_MAX * 2)/20,
				.u32WndY = (UI_COORD_MAX * 5)/20,
				.u32WndWidth = (UI_COORD_MAX * 4)/12 + (UI_COORD_MAX * 1)/30,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},
	{
		.enType = WND_WIDGET_TYPE_EDIT_E,
		.unPrivate = {
			.stEdit = {
				.u32Type = 0,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				//.u64Style = WS_CHILD | WS_VISIBLE | MBS_ALIGNCENTER|MBS_NOBUTTON|WS_BORDER,
				//.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SLEEP_BATT_LOW_INPUT,
				.u32WndX = (UI_COORD_MAX * 10)/20,
				.u32WndY = (UI_COORD_MAX * 5)/20,
				.u32WndWidth = (UI_COORD_MAX * 2)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/12,
				.enBkColor = UI_COLOR_LIGHTWHITE_E,
				.bShowNow = true,
				//.bBorder = true,
				.stFont = {
					.enFontColor = UI_COLOR_BLACK_E,
				},
			},
			.stFops = {
				.CallBack = WND_SET_EditProc,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "(8~11.5)V",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_STAR_UP_INFO,
				.u32WndX = (UI_COORD_MAX * 13)/20,
				.u32WndY = (UI_COORD_MAX * 5)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},


	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "恢复开机值",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_STAR_UP_INFO,
				.u32WndX = (UI_COORD_MAX * 2)/20,
				.u32WndY = (UI_COORD_MAX * 7)/20,
				.u32WndWidth = (UI_COORD_MAX * 4)/12 + (UI_COORD_MAX * 1)/30,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},
	{
		.enType = WND_WIDGET_TYPE_EDIT_E,
		.unPrivate = {
			.stEdit = {
				.u32Type = 0,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				//.u64Style = WS_CHILD | WS_VISIBLE | MBS_ALIGNCENTER|MBS_NOBUTTON|WS_BORDER,
				//.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SLEEP_REST_VOL_INPUT,
				.u32WndX = (UI_COORD_MAX * 10)/20,
				.u32WndY = (UI_COORD_MAX * 7)/20,
				.u32WndWidth = (UI_COORD_MAX * 2)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/12,
				.enBkColor = UI_COLOR_LIGHTWHITE_E,
				.bShowNow = true,
				//.bBorder = true,
				.stFont = {
					.enFontColor = UI_COLOR_BLACK_E,
				},
			},
			.stFops = {
				.CallBack = WND_SET_EditProc,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "(10~14)V",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_STAR_UP_INFO,
				.u32WndX = (UI_COORD_MAX * 13)/20,
				.u32WndY = (UI_COORD_MAX * 7)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},




	{
			.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,

			.stCommon = {
				.stAttr = {
					.s8Name = "低电压是否上报",
					.u32WndId = 0,
					.u32Group = 0,
					//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
					.u64ExStyle = WS_EX_NONE,
					.u32Id = IDC_SLEEP_LOW_REP_INFO,
					.u32WndX = (UI_COORD_MAX * 2)/20,
					.u32WndY = (UI_COORD_MAX * 9)/20,
					.u32WndWidth = (UI_COORD_MAX * 4)/12 + (UI_COORD_MAX * 1)/30,
					.u32WndHeight = (UI_COORD_MAX * 1)/10,
					.enBkColor = UI_COLOR_DEFAULT_E,
					.bShowNow = true,
					//.bBorder = true,
				},
				.stFops = {
					//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
				},
			},
		},

	{
		.enType = WND_WIDGET_TYPE_MULTI_BUTTON_E,
		.unPrivate = {
			.stMultiButton = {
				.s32AutoCheck = 1,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SLEEP_LOW_REP_INPUT,
				.u32WndX = (UI_COORD_MAX * 10)/20,
				.u32WndY = (UI_COORD_MAX * 9)/20,
				.u32WndWidth = (UI_COORD_MAX * 2)/40,
				.u32WndHeight = (UI_COORD_MAX * 1)/20,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
				.stFont = {
					.enFontColor = UI_COLOR_BLACK_E,
				},
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},



	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "点火休眠延时",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SLEEP_IGN_DELAY_INFO,
				.u32WndX = (UI_COORD_MAX * 1)/20,
				.u32WndY = (UI_COORD_MAX * 11)/20,
				.u32WndWidth = (UI_COORD_MAX * 4)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_EDIT_E,
		.unPrivate = {
			.stEdit = {
				.u32Type = 0,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "",
				//.u32WndId = ,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				//.u64Style = WS_CHILD | WS_VISIBLE |WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SLEEP_IGN_DELAY_INPUT,
				.u32WndX = (UI_COORD_MAX * 8)/20,
				.u32WndY = (UI_COORD_MAX * 11)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/12,
				.enBkColor = UI_COLOR_LIGHTWHITE_E,
				.bShowNow = true,
				.bBorder = true,
				.stFont = {
					.enFontColor = UI_COLOR_BLACK_E,
				},
			},
			.stFops = {
				.CallBack = WND_SET_EditProc,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "(1~10)分钟",
				.u32WndId = 0,
				.u32Group = 0,
				//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SLEEP_IGN_DELAY_INFO2,
				.u32WndX = (UI_COORD_MAX * 14)/20,
				.u32WndY = (UI_COORD_MAX * 11)/20,
				.u32WndWidth = (UI_COORD_MAX * 3)/12,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},






				{
					.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
					.stCommon = {
						.stAttr = {
							.s8Name = "断电火休眠延时",
							.u32WndId = 0,
							.u32Group = 0,
							//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
							.u64ExStyle = WS_EX_NONE,
							.u32Id = IDC_SLEEP_OUTAGE_MODE_INFO,
							.u32WndX = (UI_COORD_MAX * 1)/20,
							.u32WndY = (UI_COORD_MAX * 13)/20,
							.u32WndWidth = (UI_COORD_MAX * 4)/12,
							.u32WndHeight = (UI_COORD_MAX * 1)/10,
							.enBkColor = UI_COLOR_DEFAULT_E,
							.bShowNow = true,
							//.bBorder = true,
						},
						.stFops = {
							//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
						},
					},
				},

				{
					.enType = WND_WIDGET_TYPE_EDIT_E,
					.unPrivate = {
						.stEdit = {
							.u32Type = 0,
						},
					},
					.stCommon = {
						.stAttr = {
							.s8Name = "",
							//.u32WndId = IDC_SLEEP_OUTAGE_MODE_INPUT,
							.u32Group = 0,
							//.u32ParentWndId = HWND_DESKTOP,
							//.u64Style = WS_CHILD | WS_VISIBLE |WS_BORDER,
							.u64ExStyle = WS_EX_NONE,
							.u32Id = IDC_SLEEP_OUTAGE_MODE_INPUT,
							.u32WndX = (UI_COORD_MAX * 8)/20,
							.u32WndY = (UI_COORD_MAX * 13)/20,
							.u32WndWidth = (UI_COORD_MAX * 3)/12,
							.u32WndHeight = (UI_COORD_MAX * 1)/12,
							.enBkColor = UI_COLOR_LIGHTWHITE_E,
							.bShowNow = true,
							.bBorder = true,
							.stFont = {
								.enFontColor = UI_COLOR_BLACK_E,
							},
						},
						.stFops = {
							.CallBack = WND_SET_EditProc,
						},
					},
				},

				{
					.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
					.stCommon = {
						.stAttr = {
							.s8Name = "(0~60)秒",
							.u32WndId = 0,
							.u32Group = 0,
							//.u64Style = WS_VISIBLE | SS_LEFT| WS_CHILD | WS_BORDER,
							.u64ExStyle = WS_EX_NONE,
							.u32Id = IDC_SLEEP_OUTAGE_MODE_INFO2,
							.u32WndX = (UI_COORD_MAX * 14)/20,
							.u32WndY = (UI_COORD_MAX * 13)/20,
							.u32WndWidth = (UI_COORD_MAX * 3)/12,
							.u32WndHeight = (UI_COORD_MAX * 1)/10,
							.enBkColor = UI_COLOR_DEFAULT_E,
							.bShowNow = true,
							//.bBorder = true,

						},
						.stFops = {
							//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
						},
					},
				},




	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "保存",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_VISIBLE | BS_DEFPUSHBUTTON | WS_TABSTOP | WS_GROUP,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_DEV_SWITCH_SAVE,
				.u32WndX = (UI_COORD_MAX * 15)/20,
				.u32WndY = (UI_COORD_MAX * 15)/20,
				.u32WndWidth = (UI_COORD_MAX * 2)/20,
				.u32WndHeight = (UI_COORD_MAX * 1)/10,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
				.stFont = {
					.s32FontSize = 20,
				},
			},
			.stFops = {
				.CallBack = WND_SET_CallBackAttrPageSleep,
			},
		},
	},
#endif
};




WND_WIDGET_S stGlbAttrPageDevOnOffInfo[] = {
	{
		.enType = WND_WIDGET_TYPE_ATTR_PAGE_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "开关机",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_NOTIFY,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = BASIC_MSG_REGISTER_E,
				.u32WndX = (UI_COORD_MAX * 0)/6,
				.u32WndY = (UI_COORD_MAX * 0)/5,
				.u32WndWidth = (UI_COORD_MAX * 1)/6,
				.u32WndHeight = (UI_COORD_MAX * 1)/5,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.stFont = {
					.s32FontSize = 10,
					.enFontColor = UI_COLOR_BLACK_E,
				},
			},
			.stFops = {
				.CallBack = MINI_SET_WND_AttrPageProcPowerOnOff,
			},
		},
		.pstWidget = stGlbAttrPageDevOnOffInfoCtrl,
		.s32WidgetNum = sizeof(stGlbAttrPageDevOnOffInfoCtrl) / sizeof(stGlbAttrPageDevOnOffInfoCtrl[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_ATTR_PAGE_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "休眠",
				.u32WndId = 0,
				.u32Group = 0,
				.u64Style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_NOTIFY,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = BASIC_MSG_REGISTER_E,
				.u32WndX = (UI_COORD_MAX * 0)/6,
				.u32WndY = (UI_COORD_MAX * 0)/5,
				.u32WndWidth = (UI_COORD_MAX * 1)/6,
				.u32WndHeight = (UI_COORD_MAX * 1)/5,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.stFont = {
					.s32FontSize = 10,
				},
			},
			.stFops = {
				.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
		.pstWidget = stGlbAttrPageDevOnOffSleepInfoCtrl,
		.s32WidgetNum = sizeof(stGlbAttrPageDevOnOffSleepInfoCtrl) / sizeof(stGlbAttrPageDevOnOffSleepInfoCtrl[0]),

	},


};

WND_WIDGET_S stGlbAttrPageDevOnOff = {

	.enType = WND_WIDGET_TYPE_ATTR_LIST_E,
	.stCommon = {
		.stAttr = {
			.s8Name = "开关机属性表",
			.u32WndId = 0,
			.u32Group = BASIC_MSG_DEV_ON_OFF_ATTR_PAGE_E,
			//.u32ParentWndId = HWND_DESKTOP,
			.u64Style = WS_BORDER | WS_CHILD | WS_VISIBLE| PSS_COMPACTTAB | PSS_SIMPLE | PSS_SCROLLABLE,
			//.u64Style = WS_BORDER | WS_CHILD | WS_VISIBLE | PSS_COMPACTTAB,
			.u64ExStyle = WS_EX_NONE,
			.u32Id = IDC_SET_BASIC_DEV_SWITCH,
			.u32WndX = (UI_COORD_MAX*1)/6 + (UI_COORD_MAX*1)/20,
			.u32WndY = (UI_COORD_MAX*1)/5 + (UI_COORD_MAX*1)/14,//(UI_COORD_MAX*1)/45,
			.u32WndWidth = (UI_COORD_MAX*4)/5 - (UI_COORD_MAX*1)/31,
			.u32WndHeight = UI_COORD_MAX - ((UI_COORD_MAX*1)/5 + (UI_COORD_MAX*2)/30),
			.enBkColor = UI_COLOR_DEFAULT_E,
			.bShowNow = true,
			.stFont = {
				.s32FontSize = 20,
			},
		},
		.stFops = {
			//.CallBack = MINI_SET_WND_AttrPageProcPowerOnOff,
		},
	},

	.pstWidget = stGlbAttrPageDevOnOffInfo,
	.s32WidgetNum = sizeof(stGlbAttrPageDevOnOffInfo) / sizeof(stGlbAttrPageDevOnOffInfo[0]),

};




WND_WIDGET_S stGlbSetWndChildCtrlBasicSet[] = {
#if 1
	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.unPrivate = {
			.stButton= {
				.enCurselBkColor = UI_COLOR_ORANGE_E,	//	选中时候的背景颜色
				.enCurselFontColor = UI_COLOR_BLACK_E,					//	选中时候的字体颜色
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "注册消息",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_NOTIFY | SS_NOTIFY | SS_CENTER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = BASIC_MSG_REGISTER_E,
				.u32WndX = (UI_COORD_MAX * 0)/6,
				.u32WndY = (UI_COORD_MAX * 0)/5,
				.u32WndWidth = (UI_COORD_MAX * 1)/6,
				.u32WndHeight = (UI_COORD_MAX * 1)/5,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackBasicListRegister,
			},
		},
	},
	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.unPrivate = {
			.stButton= {
				.enCurselBkColor = UI_COLOR_ORANGE_E,	//	选中时候的背景颜色
				.enCurselFontColor = UI_COLOR_BLACK_E,					//	选中时候的字体颜色
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "时间设置",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_NOTIFY | SS_NOTIFY | SS_CENTER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = BASIC_MSG_TIME_E,
				.u32WndX = (UI_COORD_MAX * 0)/6,
				.u32WndY = (UI_COORD_MAX * 0)/5,
				.u32WndWidth = (UI_COORD_MAX * 1)/6,
				.u32WndHeight = (UI_COORD_MAX * 1)/5,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackBasicListTimeSet,
			},
		},
	},
#endif
	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.unPrivate = {
			.stButton= {
				.enCurselBkColor = UI_COLOR_ORANGE_E,	//	选中时候的背景颜色
				.enCurselFontColor = UI_COLOR_BLACK_E,					//	选中时候的字体颜色
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "开关机",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_NOTIFY | SS_NOTIFY | SS_CENTER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = BASIC_MSG_DEV_ON_OFF_E,
				.u32WndX = (UI_COORD_MAX * 0)/6,
				.u32WndY = (UI_COORD_MAX * 0)/5,
				.u32WndWidth = (UI_COORD_MAX * 1)/6,
				.u32WndHeight = (UI_COORD_MAX * 1)/5,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackBasicListDevOnOff,
			},
		},
		.pstWidget = &stGlbAttrPageDevOnOff,
		.s32WidgetNum = 1,//sizeof(stGlbAttrPageDevOnOff) / sizeof(stGlbAttrPageDevOnOff[0]),
	},

	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.unPrivate = {
			.stButton= {
				.enCurselBkColor = UI_COLOR_ORANGE_E,	//	选中时候的背景颜色
				.enCurselFontColor = UI_COLOR_BLACK_E,					//	选中时候的字体颜色
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "用户设置",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_NOTIFY | SS_NOTIFY | SS_CENTER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = BASIC_MSG_USER_E,
				.u32WndX = (UI_COORD_MAX * 0)/6,
				.u32WndY = (UI_COORD_MAX * 0)/5,
				.u32WndWidth = (UI_COORD_MAX * 1)/6,
				.u32WndHeight = (UI_COORD_MAX * 1)/5,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackBasicListUser,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.unPrivate = {
			.stButton= {
				.enCurselBkColor = UI_COLOR_ORANGE_E,	//	选中时候的背景颜色
				.enCurselFontColor = UI_COLOR_BLACK_E,					//	选中时候的字体颜色
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "网络设置",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_NOTIFY | SS_NOTIFY | SS_CENTER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = BASIC_MSG_NET_E,
				.u32WndX = (UI_COORD_MAX * 0)/6,
				.u32WndY = (UI_COORD_MAX * 0)/5,
				.u32WndWidth = (UI_COORD_MAX * 1)/6,
				.u32WndHeight = (UI_COORD_MAX * 1)/5,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackBasicListNet,
			},
		},

	},
	{
		.enType = WND_WIDGET_TYPE_BUTTON_E,
		.unPrivate = {
			.stButton= {
				.enCurselBkColor = UI_COLOR_ORANGE_E,	//	选中时候的背景颜色
				.enCurselFontColor = UI_COLOR_BLACK_E,					//	选中时候的字体颜色
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "网络应用",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_NOTIFY | SS_NOTIFY | SS_CENTER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = BASIC_MSG_NET_APP_E,
				.u32WndX = (UI_COORD_MAX * 0)/6,
				.u32WndY = (UI_COORD_MAX * 0)/5,
				.u32WndWidth = (UI_COORD_MAX * 1)/6,
				.u32WndHeight = (UI_COORD_MAX * 1)/5,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackBasicListNetApp,
			},
		},

	},

};


WND_WIDGET_S stGlbSetChileCtrlHandle[] = {

	{
#if 0
		.enType = WND_WIDGET_TYPE_SCROLL_E,
		.unPrivate = {
			.stListMenu= {
				.s32ChildArray = 3,
				.s32Left = (UI_COORD_MAX*1)/60,						/* 左 端空隙的距离*/
				.s32Right = (UI_COORD_MAX*1)/4,						/* 右 端空隙的距离*/
				.s32Top = (UI_COORD_MAX*1)/60,							/* 上 端空隙的距离*/
				.s32Bottom = (UI_COORD_MAX*1)/50,					/* 下 端空隙的距离*/
				//.pstMenuList = stGlbBasicSetButton,
				//.s32MenuListNum = sizeof(stGlbBasicSetButton)/sizeof(stGlbBasicSetButton[0]),
				.u32Ctrlheight = (UI_COORD_MAX * 2)/8,
			},
		},
#else
		.enType = WND_WIDGET_TYPE_CTRL_SETS_E,
		.unPrivate = {
			.stCtrlSets = {
				.s32Direction = 1,		/* 创建横向的*/
				.bHScroll = true,
				.bVScroll = true,
				.s32Height = (UI_COORD_MAX*2)/6,
				.s32Left = (UI_COORD_MAX*1)/120,						/* 左 端空隙的距离*/
				.s32Right = (UI_COORD_MAX*1)/120,						/* 右 端空隙的距离*/
				.s32Top = (UI_COORD_MAX*1)/60,							/* 上 端空隙的距离*/
				.s32Bottom = (UI_COORD_MAX*1)/50,					/* 下 端空隙的距离*/
			},
		},
#endif
		.stCommon = {
			.stAttr = {
				.s8Name = "基础设置列表",
				.u32WndId = 0,
				.u32Group = 0,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = WS_BORDER | WS_VISIBLE | WS_VSCROLL,
				//.u64Style = WS_BORDER | WS_VISIBLE,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = IDC_SET_BASIC_LIST,
				.u32WndX = (UI_COORD_MAX*0)/6 + (UI_COORD_MAX*1)/60,
				.u32WndY = (UI_COORD_MAX*1)/5 + (UI_COORD_MAX*1)/15,//(UI_COORD_MAX*1)/45,
				.u32WndWidth = (UI_COORD_MAX*1)/5,
				//.u32WndHeight = (UI_COORD_MAX*14)/20,
				.u32WndHeight = UI_COORD_MAX - ((UI_COORD_MAX*1)/5 + (UI_COORD_MAX*5)/60),
				.enBkColor = UI_COLOR_BLACK_E,
				.bShowNow = true,
				.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackBasicSetList,
			},
			//WND_STA_S stSta;
		},

		.pstWidget = stGlbSetWndChildCtrlBasicSet,
		.s32WidgetNum = sizeof(stGlbSetWndChildCtrlBasicSet) / sizeof(stGlbSetWndChildCtrlBasicSet[0]),
	},
};














WND_WIDGET_S stGlbSetMenuWnd[] = {


	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = "share/res/png/set/基础设置-橙.png",
				.s8MapPathCursel = "share/res/png/set/基础设置-白.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "基础设置",
				.u32WndId = 0,
				.u32Group = 2,
				.u32Id = DEV_SET_BASIC_SET_E,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackBasicSet,
			},
		},
		.pstWidget = stGlbSetChileCtrlHandle,
		.s32WidgetNum = sizeof(stGlbSetChileCtrlHandle) / sizeof(stGlbSetChileCtrlHandle[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = "share/res/png/set/视频监控-橙.png",
				.s8MapPathCursel = "share/res/png/set/视频监控-白.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "视频监控",
				.u32WndId = 0,
				.u32Group = 2,
				.u32Id = DEV_SET_VIDEO_E,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackVideoSet,
			},
		},
	},
	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = "share/res/png/set/数据采集-橙.png",
				.s8MapPathCursel = "share/res/png/set/数据采集-白.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "数据采集",
				.u32WndId = 0,
				.u32Group = 2,
				.u32Id = DEV_SET_DATE_E,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackGetDate,
			},
		},
	},
	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = "share/res/png/set/报警设置-橙.png",
				.s8MapPathCursel = "share/res/png/set/报警设置-白.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "报警设置",
				.u32WndId = 0,
				.u32Group = 2,
				.u32Id = DEV_SET_ALARM_E,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackAlarmSet,
			},
		},
	},
	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = "share/res/png/set/设备维护-橙.png",
				.s8MapPathCursel = "share/res/png/set/设备维护-白.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "设备维护",
				.u32WndId = 0,
				.u32Group = 2,
				.u32Id = DEV_SE_DEV_QUE_E,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackDevSet,
			},
		},
	},
	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = "share/res/png/set/返回-橙.png",
				.s8MapPathCursel = "share/res/png/set/返回-白.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "返回",
				.u32WndId = 0,
				.u32Group = 2,
				.u32Id = DEV_SETT_QUIT_E,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_SET_CallBackReturn,
			},
		},
	},
};



WND_WIDGET_S stGlbSetWndCtrl[] = {


	{
		.enType = WND_WIDGET_TYPE_CTRL_SETS_E,
		.unPrivate = {
			.stCtrlSets = {
				.s32Direction = 0,		/* 创建横向的*/
				.s32Left = (UI_COORD_MAX*1)/120,						/* 左 端空隙的距离*/
				.s32Right = (UI_COORD_MAX*1)/120,						/* 右 端空隙的距离*/
				.s32Top = (UI_COORD_MAX*1)/60,							/* 上 端空隙的距离*/
				.s32Bottom = (UI_COORD_MAX*1)/50,					/* 下 端空隙的距离*/
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "控件集合",
				.u32Group = WND_SET_GROP_MENU,
				.u32Id = IDC_SET_CTRL_SETS,
				.u32WndX = (UI_COORD_MAX*0)/6 + (UI_COORD_MAX*1)/60,
				.u32WndY = (UI_COORD_MAX*0)/4 + (UI_COORD_MAX*1)/30,//(UI_COORD_MAX*1)/45,
				.u32WndWidth = (UI_COORD_MAX*6)/6 - (UI_COORD_MAX*1)/80 - (UI_COORD_MAX*1)/60,
				.u32WndHeight = (UI_COORD_MAX*1)/5 + (UI_COORD_MAX*1)/30,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
			},
			.stFops = {
				//.CallBack = WND_MAIN_MenuProc,
			},
			//WND_STA_S stSta;
		},

		.pstWidget = stGlbSetMenuWnd,
		.s32WidgetNum = sizeof(stGlbSetMenuWnd) / sizeof(stGlbSetMenuWnd[0]),
	},

};
















WND_WIDGET_S stGlbSetWindow = {
	.enType = WND_WIDGET_TYPE_MAIN_E,
	//WND_WIDGET_ATTR_U unWidget;
	.stCommon = {
		.stAttr = {
			.s8Name = "设置",
			.u32WndId = 0,
			.u32Group = MAIN_WND_TYPE_SET_E,
			//.u32ParentWndId = HWND_DESKTOP,
			//.u64Style = WS_VISIBLE | WS_BORDER,
			//.u64ExStyle = WS_EX_NONE,
			.u32Id = 0,
			.u32WndX = 0,
			.u32WndY = 0,
			.u32WndWidth = UI_COORD_MAX,
			.u32WndHeight = UI_COORD_MAX,
			.enBkColor = UI_COLOR_DEFAULT_E,
			.bShowNow = true,
			.bBorder = true,
		},
		.stFops = {
			.CallBack = WND_SET_Proc,
		},
		//WND_STA_S stSta;
	},

	.pstWidget = stGlbSetWndCtrl,
	.s32WidgetNum = sizeof(stGlbSetWndCtrl) / sizeof(stGlbSetWndCtrl[0]),

};

